An Arduino library for reading the DHT11 sensor of temperature and humidity.
Written by Mark Ruys, mark@paracas.nl.
- Support for DHT11 only
- Low memory footprint
- Very small code
#include "DHT11.h"
DHT11 dht;
void setup()
{
Serial.begin(9600);
dht.setup(2); // data pin 2
}
void loop()
{
delay(dht.getMinimumSamplingPeriod());
Serial.print(dht.getHumidity());
Serial.print("\t");
Serial.print(dht.getTemperature());
}
Place the DHT11 folder in your <arduinosketchfolder>/libraries/
folder (Usually c:\Users\YourUser\Documents\Arduino\libraries).
You may need to create the libraries
subfolder if its your first library. Restart the Arduino IDE.