Arduino101Humidity 湿度和温度
Arduino101Humidity 湿度和温度组件让用户可以从 Grove DHT11 传感器收集湿度和温度数据。温度数据以摄氏度为单位,相对湿度以百分比为单位。
<img class=’centered’ alt=’Grove 温湿度传感器图片’src=’/assets/sensors/Grove-TempAndHumiSensor.jpg’>
更多链接:<ul><li>下载 Arduino 101 湿度传感器的示例项目。</li><li>下载 Arduino 101 温度传感器的示例项目。</li><li>查看Arduino 101 湿度传感器的使用方法说明。</li><li>查看 Arduino 101 温度传感器的使用方法说明。</li></ul>
属性
BluetoothDevice
– The BluetoothLE component with a connection to the Arduino 101.
方法
IsSupported
– Tests whether the Bluetooth low energy device is broadcasting support for the service. If true, calls to TurnOn and TurnOff should work correctly. Otherwise an error will be reported through the Screen’s ErrorOccurred event.
ReadHumidity
– Read the current humidity from the attached sensor. On success, theHumidityReceived
event will be run with the received humidity measurement.
ReadTemperature
– Read the current temperature from the attached sensor. On success, theTemperatureReceived
event will be run with the received temperature measurement.
RequestHumidityUpdates
– Request notifications from the Arduino for changes in the humidity sensor reading. TheHumidityReceived
event will be run as samples are received from the Arduino.
RequestTemperatureUpdates
– Request notifications from the Arduino for changes in the temperature sensor reading. TheTemperatureReceived
event will be run as samples are received from the Arduino.
StopHumidityUpdates
– Stop listening for notifications of changes in the humidity sensor reading. This only has an effect if there was a previous call toRequestHumidityUpdates
. There may be additional pending messages that will be processed by runningHumidityReceived
.
StopTemperatureUpdates
– Stop listening for notifications of changes in the temperature sensor reading. This only has an effect if there was a previous call toRequestTemperatureUpdates
. There may be additional pending messages that will be processed by runningTemperatureReceived
.
事件
HumidityReceived
– TheHumidityReceived
event is run whenever humidity samples are received from the Arduino. This is usually a result of performing a read or request operation. The humidity value is a relative humidity between 0-100%.
Parameters:
* <code>humidity</code> (<a href="http://appinventor.mit.edu/explore/ai2/support/blocks/math.html#number">_number_</a>) — The relative humidity, in percent.
TemperatureReceived
– TheTemperatureReceived
event is run whenever temperature samples are received from the Arduino. This is usually a result of performing a <a href=”#ReadTemperature>read</a> or request operation. The temperature value is measured in degrees Celsius.
Parameters:
* <code>temperature</code> (<a href="http://appinventor.mit.edu/explore/ai2/support/blocks/math.html#number">_number_</a>) — The temperature, in degrees Celsius.