Advertisement
Guest User

3/31/20 Temperature Sensor

a guest
Apr 1st, 2020
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 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. if (DHT.temperature > -10)
  17. {
  18. Serial.print("Temperature = ");
  19. Serial.println(DHT.temperature);
  20. Serial.print("Humidity = ");
  21. Serial.println(DHT.humidity);
  22. delay(1000);
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement