#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd (0x27,20 ,4);
#include<Servo.h>
Servo servo ;
#include <DHT.h>
DHT dht(13,DHT22);
#include <IRremote.h>
#define pinRec 1 
IRrecv receiver (pinRec); 
int c=0;
void setup() {
 lcd.init();
 lcd.backlight();
 servo.attach(3);
 dht.begin();
 receiver .  enableIRIn();
 pinMode(7, OUTPUT);
  
}

void loop() { 

  lcd.clear();
  if(receiver.decode())
    trans();
    receiver.resume();
    
   
}

void trans(){
  switch(receiver.decodedIRData.command)
  {
    
    case 48:
      lcd.setCursor (0,0);
lcd.print ("1");
c=c+1;
if (c%2!=0)
digitalWrite(7,HIGH);
else
digitalWrite(7,LOW);
break;
case 24:
 lcd.setCursor (0,0);
lcd.print ("2");
servo.write(0);
delay(500);
break;
case 90:

lcd.setCursor (0,0);
     lcd.print("6");
     int hum=dht.readHumidity ();
    lcd.setCursor (0,1);
     lcd.print("HUM ");
     lcd.print(hum);
     delay(1000);
     break;
  }


}