SHARE
TWEET

code

a guest Feb 17th, 2020 76 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <dht.h>
  2.  
  3. #include <dht.h>
  4. #include <LiquidCrystal.h>
  5.  
  6. LiquidCrystal lcd(12, 13, 5, 4, 3, 2);
  7.  
  8. dht DHT;
  9.  
  10. #define DHT11_PIN 7
  11. const int SER =8;
  12. const int LATCH =6;
  13. const int CLK =10 ;
  14. void setup(){
  15.   Serial.begin(9600);
  16.   lcd.begin(16,2);
  17.   lcd.clear();
  18.   pinMode(SER,OUTPUT);
  19.    pinMode(LATCH,OUTPUT);
  20.    pinMode(CLK,OUTPUT);
  21.    digitalWrite(LATCH,LOW);
  22.    shiftOut(SER,CLK,MSBFIRST,B11111111);
  23.    digitalWrite(LATCH,HIGH);
  24.  
  25.  
  26. void loop()
  27. {
  28.   int chk = DHT.read11(DHT11_PIN);
  29.   if(DHT.temperature> -32){
  30.   lcd.setCursor(0,0);
  31.   lcd.print("Temp= ");
  32.    lcd.setCursor(6,0);
  33.   lcd.print(DHT.temperature);
  34.   delay(500);
  35.   }
  36.   if(DHT.temperature > 15){
  37.   lcd.setCursor(0,1);
  38.   lcd.print("Cold Boba! :)");
  39.   delay(500);
  40.   for (angle =1; angle <180; angle++)
  41. {
  42.  
  43.   // set the servo position
  44.   myServo.write(angle);
  45.  
  46.   // wait for the servo to get there
  47.   delay(15);
  48.  
  49.   }
  50.   }
  51.   if(DHT.temperature < 15){
  52.   lcd.setCursor(0,1);
  53.   lcd.print("Hot Boba! :)");
  54.  
  55.  
  56.   }
  57.   }
  58.  
  59.  
  60.  
  61. //if(DHT. temperature);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top