#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,16,2);
#include <IRremote.h>
#define signal 10
#define num1 48
#define num2 24
#define num3 122
#define power 162
void setup() {
lcd.init();
lcd.backlight();
Serial.begin(9600);
IrReceiver.begin(signal);
// put your setup code here, to run once:
}
void loop() {
if(IrReceiver.decode())
{
Serial.println(IrReceiver.decodedIRData.command);
IrReceiver.resume();
int Data =IrReceiver.decodedIRData.command;
switch(Data)
{
case num1:
Serial.println("1 button is pressed");
lcd.clear();
lcd.setCursor(0,0);
lcd.print("pressed 1");
break;
case num2:
lcd.clear();
Serial.println("2 button is pressed");
lcd.clear();
lcd.setCursor(0,0);
lcd.print("pressed 2");
break;
case num3:
Serial.println("3 button is pressed");
lcd.clear();
lcd.setCursor(0,0);
lcd.print("pressed 3 ");
break;
case power:
Serial.println("power button is pressed");
lcd.clear();
lcd.setCursor(0,0);
lcd.print("pressed power ");
break;
default:
Serial.println("another button is pressed");
lcd.clear();
lcd.setCursor(0,0);
lcd.print("pressed another button ");
}
}
}