Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Code for DHT11 & other variants - Connect Signal pin to Digital pin no. 7
- * Available for reproduction with proper attributions
- * Commented wherever necessary
- */
- #include <dht.h>
- dht DHT;
- #define DHT11_PIN 7
- void setup(){
- Serial.begin(9600);
- }
- void loop()
- {
- int chk = DHT.read11(DHT11_PIN); //Reads the status of Sensor
- Serial.print("Temperature = "); //Print out the text
- Serial.println(DHT.temperature); // The functions that checks the temperature
- Serial.print("Humidity = "); // Prints out the text
- Serial.println(DHT.humidity); // This functions checks the humidity
- delay(1000); //formality + decency
- }
Add Comment
Please, Sign In to add comment