Supporting code snippets for http://everydaylifein.net/iot/arduino-dht-sensor-protocol.html
#include <DHTSensor.h> | |
DHTSensor sensor(3);//Will be using pin3 for collecting the data | |
void loop() | |
{ | |
DHTSensorMeasurement re = sensor.Read(); | |
if (!re.HasError()) | |
{ | |
Serial.print("H: "); | |
Serial.print(re.Humidity()); | |
Serial.print(" T: "); | |
Serial.print(re.TemperatureInCelsius()); | |
Serial.print(" T(F): "); | |
Serial.print(re.TemperatureInFahrenheit()); | |
Serial.print(" T(K): "); | |
Serial.println(re.TemperatureInKelvin()); | |
} | |
} |
//Will be using pin3 for collecting the data and pin7 for powering up the sensor | |
DHTSensor sensor(3, 7); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment