The Sensor sub-class for the AOSong digital-output relative humidity and temperature sensor modules.
- class Sensor
- The "Sensor" class is used for all sensor-level operations - waking, sleeping, and taking measurements.
Constructors, destructors, conversion operators
Construct a new AOSongDHT object - need the power pin, the data pin, and the sensor type.
The pin on the mcu controlling power to the AOSong DHT. Use -1 if it is continuously powered.
|dataPin||The pin on the mcu receiving data from the AOSong DHT|
The type of DHT. Possible values are DHT11, DHT21, AM2301, DHT22, or AM2302.
|measurementsToAverage||The number of measurements to take and average before giving a "final" result from the sensor; optional with a default value of 1.|
StringgetSensorName(void ) override
Get the name of the sensor.
|Returns||String The sensor name as given in the constructor.|
booladdSingleMeasurementResult(void ) override
Get the results from a single measurement.
|Returns||bool True if the function completed successfully.|
This asks the sensor for a new result, verifies that it passes sanity range checks, and then adds the value to the result array.