Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <dht.h>
- #include <dht.h>
- #include <LiquidCrystal.h>
- LiquidCrystal lcd(12, 13, 5, 4, 3, 2);
- dht DHT;
- #define DHT11_PIN 7
- const int SER =8;
- const int LATCH =6;
- const int CLK =10 ;
- void setup(){
- Serial.begin(9600);
- lcd.begin(16,2);
- lcd.clear();
- pinMode(SER,OUTPUT);
- pinMode(LATCH,OUTPUT);
- pinMode(CLK,OUTPUT);
- digitalWrite(LATCH,LOW);
- shiftOut(SER,CLK,MSBFIRST,B11111111);
- digitalWrite(LATCH,HIGH);
- void loop()
- {
- int chk = DHT.read11(DHT11_PIN);
- if(DHT.temperature> -32){
- lcd.setCursor(0,0);
- lcd.print("Temp= ");
- lcd.setCursor(6,0);
- lcd.print(DHT.temperature);
- delay(500);
- }
- if(DHT.temperature > 15){
- lcd.setCursor(0,1);
- lcd.print("Cold Boba! :)");
- delay(500);
- for (angle =1; angle <180; angle++)
- {
- // set the servo position
- myServo.write(angle);
- // wait for the servo to get there
- delay(15);
- }
- }
- if(DHT.temperature < 15){
- lcd.setCursor(0,1);
- lcd.print("Hot Boba! :)");
- }
- }
- //if(DHT. temperature);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement