Skip to content

Instantly share code, notes, and snippets.

@CosminLazar
Last active March 22, 2016 21:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CosminLazar/2f35506f9f1bae44cbe0 to your computer and use it in GitHub Desktop.
Save CosminLazar/2f35506f9f1bae44cbe0 to your computer and use it in GitHub Desktop.
#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