I have written this code for a remote controlled LCD and when I compile and upload it there are no errors, however when I tried to check if it was working nothing would show up on the LCD whenever I clicked a button on the IR controller. Does anyone have an idea as to why this is happening, if so I very much appreciate it. The code is below.
#include <IRremote.h>
#include <LiquidCrystal.h>
const int RECV_PIN = 7;
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
IRrecv irrecv(RECV_PIN);
decode_results results;
unsigned long key_value = 0;
void setup(){
Serial.begin(9600);
irrecv.enableIRIn();
irrecv.blink13(true);
lcd.begin(16, 2);
}
void loop(){
if (irrecv.decode())
if (results.value == 0XFFFFFFFF)
results.value = key_value;
lcd.setCursor(0, 0);
lcd.clear();
switch(results.value)
{
case 0xFFA25D :
{
lcd.print("OFF");
delay(1000);
lcd.clear();
break;
}
case 0xFF629D :
{
lcd.print("VOL+");
delay(1000);
lcd.clear();
break;
}
case 0xFFE21D :
{
lcd.print("FUNC/STOP");
delay(1000);
lcd.clear();
break;
}
case 0xFF22DD :
{
lcd.print("|<<");
delay(1000);
lcd.clear();
break;
}
case 0xFF02FD :
{
lcd.print(">||");
delay(1000);
lcd.clear();
break;
}
case 0xFFC23D :
{
lcd.print(">>|");
delay(1000);
lcd.clear();
break;
}
case 0xFFE01F :
{
lcd.print("DOWN");
delay(1000);
lcd.clear();
break;
}
case 0xFFA857 :
{
lcd.print("VOL-");
delay(1000);
lcd.clear();
break;
}
case 0xFF906F :
{
lcd.print("UP");
delay(1000);
lcd.clear();
break;
}
case 0xFF9867 :
{
lcd.print("EQ");
delay(1000);
lcd.clear();
break;
}
case 0xFFB04F :
{
lcd.print("ST/REPT");
delay(1000);
lcd.clear();
break;
}
case 0xFF30CF :
{
lcd.print("1");
break;
}
case 0xFF18E7 :
{
lcd.print("2");
break;
}
case 0xFF7A85 :
{
lcd.print("3");
break;
}
case 0xFF10EF :
{
lcd.print("4");
break;
}
case 0xFF38C7 :
{
lcd.print("5");
break;
}
case 0xFF5AA5 :
{
lcd.print("6");
break;
}
case 0xFF42BD :
{
lcd.print("7");
break;
}
case 0xFF4AB5 :
{
lcd.print("8");
break;
}
case 0xFF52AD :
{
lcd.print("9");
break;
}
}
}