Guest User

Digit March - 2016

a guest
Feb 11th, 2016
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2.  * Code for DHT11 & other variants - Connect Signal pin to Digital pin no. 7
  3.  * Available for reproduction with proper attributions
  4.  * Commented wherever necessary
  5.  */
  6. #include <dht.h>
  7. dht DHT;
  8. #define DHT11_PIN 7
  9.  
  10. void setup(){
  11.   Serial.begin(9600);
  12. }
  13.  
  14. void loop()
  15. {
  16.   int chk = DHT.read11(DHT11_PIN); //Reads the status of Sensor
  17.   Serial.print("Temperature = "); //Print out the text
  18.   Serial.println(DHT.temperature); // The functions that checks the temperature
  19.   Serial.print("Humidity = "); // Prints out the text
  20.   Serial.println(DHT.humidity); // This functions checks the humidity
  21.   delay(1000); //formality + decency
  22. }
Add Comment
Please, Sign In to add comment