Advertisement
tBOz16

humidity and temp sensor

Mar 31st, 2020
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. #include <dht.h>
  2.  
  3.  
  4.  
  5. dht DHT;
  6.  
  7. #define DHT11_PIN 7
  8.  
  9. void setup(){
  10. Serial.begin(9600);
  11. }
  12.  
  13. void loop()
  14. {
  15. int chk = DHT.read11(DHT11_PIN);
  16. Serial.print("Temperature = ");
  17. Serial.println(DHT.temperature);
  18. Serial.print("Humidity = ");
  19. Serial.println(DHT.humidity);
  20. delay(1000);
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement