Arduino101 湿度和温度

« 返回首页

Arduino101Humidity 湿度和温度

The Arduino101Humidity component lets users gather humidity and temperature data from a Grove DHT11 sensor. Temperature data are reported in degrees Celsius and the relative humidity is reported in percent.
<img class=’centered’ alt=’Image of a Grove temperature and humidity sensor’src=’/assets/sensors/Grove-TempAndHumiSensor.jpg’>

More links:<ul><li>Download a sample project for the Arduino 101 Humidity sensor.</li><li>Download a sample project for the Arduino 101 Temperature sensor.</li><li>View the how to instructions for the Arduino 101 Humidity sensor.</li><li>View the how to instructions for the Arduino 101 Temperature sensor.</li></ul>

Properties

  • BluetoothDevice – The BluetoothLE component with a connection to the Arduino 101.

get Arduino101Humidity1 BluetoothDevice

set Arduino101Humidity1 BluetoothDevice  to

  • Pin – The Pin on the Arduino board that the device is wired in to.

get Arduino101Humidity1 Pin

set Arduino101Humidity1 Pin  to

Methods

  • 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.

call Arduino101Humidity1 IsSupported

  • ReadHumidity – Read the current humidity from the attached sensor. On success, the HumidityReceived event will be run with the received humidity measurement.

call Arduino101Humidity1 ReadHumidity

  • ReadTemperature – Read the current temperature from the attached sensor. On success, the TemperatureReceived event will be run with the received temperature measurement.

call Arduino101Humidity1 ReadTemperature

  • RequestHumidityUpdates – Request notifications from the Arduino for changes in the humidity sensor reading. The HumidityReceived event will be run as samples are received from the Arduino.

call Arduino101Humidity1 RequestHumidityUpdates

  • RequestTemperatureUpdates – Request notifications from the Arduino for changes in the temperature sensor reading. The TemperatureReceived event will be run as samples are received from the Arduino.

call Arduino101Humidity1 RequestTemperatureUpdates

  • StopHumidityUpdates – Stop listening for notifications of changes in the humidity sensor reading. This only has an effect if there was a previous call to RequestHumidityUpdates. There may be additional pending messages that will be processed by running HumidityReceived.

call Arduino101Humidity1 StopHumidityUpdates

  • StopTemperatureUpdates – Stop listening for notifications of changes in the temperature sensor reading. This only has an effect if there was a previous call to RequestTemperatureUpdates. There may be additional pending messages that will be processed by running TemperatureReceived.

call Arduino101Humidity1 StopTemperatureUpdates

Events

  • HumidityReceived – The HumidityReceived 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>) &mdash; The relative humidity, in percent.

when Arduino101Humidity1 HumidityReceived humidity do

  • TemperatureReceived – The TemperatureReceived 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>) &mdash; The temperature, in degrees Celsius.

when Arduino101Humidity1 TemperatureReceived temperature do