I can only assume I'm missing something, this sketch compiles and gives no errors, yet I cannot get the buttons to print to my LCD. The LCD shows a line of rectangles, it works when testing example code though. This is one of my first forays in to C++ and arduinos in general, I've succeeded with smaller projects and had the remote printing to serial without issue.
When it was giving errors I at least knew where to turn and what to do, now I'm a little stuck. If anyone has resources they can suggest, I'd appreciate those too.
Below is the complete code -
#include <LiquidCrystal_I2C.h>
#include <IRremote.h>
//LCD
LiquidCrystal_I2C lcd(0x27,16,2);
//IR remote and receiver
#define IR_RECEIVE_PIN 7
#define IR_REMOTE_0 0
#define IR_REMOTE_1 12
#define IR_REMOTE_2 24
#define IR_REMOTE_3 94
#define IR_REMOTE_4 8
#define IR_REMOTE_5 28
#define IR_REMOTE_6 90
#define IR_REMOTE_7 66
#define IR_REMOTE_8 82
#define IR_REMOTE_9 74
#define IR_REMOTE_POWER 69
#define IR_REMOTE_VOLUP 70
#define IR_REMOTE_FUNSTOP 71
#define IR_REMOTE_REWIND 68
#define IR_REMOTE_PLAYPAUSE 64
#define IR_REMOTE_FASTFORWARD 67
#define IR_REMOTE_DOWN 7
#define IR_REMOTE_VOLDOWN 21
#define IR_REMOTE_UP 22
#define IR_REMOTE_EQ 1548
#define IR_REMOTE_STREPT 13
void setup() {
lcd.begin(16,2);
lcd.setContrast(50);
lcd.clear();
IrReceiver.enableIRIn();
}
void loop() {
if (IrReceiver.decode()) {
switch (IrReceiver.decodedIRData.command) {
case IR_REMOTE_0:
lcd.print("0");
delay(3000);
lcd.clear();
break;
case IR_REMOTE_1:
lcd.print("1");
delay(3000);
lcd.clear();
break;
case IR_REMOTE_2:
lcd.print("2");
delay(3000);
lcd.clear();
break;
case IR_REMOTE_3:
lcd.print("3");
delay(3000);
lcd.clear();
break;
case IR_REMOTE_4:
lcd.print("4");
delay(3000);
lcd.clear();
break;
case IR_REMOTE_5:
lcd.print("5");
delay(3000);
lcd.clear();
break;
case IR_REMOTE_6:
lcd.print("6");
delay(3000);
lcd.clear();
break;
case IR_REMOTE_7:
lcd.print("7");
delay(3000);
lcd.clear();
break;
case IR_REMOTE_8:
lcd.print("8");
delay(3000);
lcd.clear();
break;
case IR_REMOTE_9:
lcd.print("9");
delay(3000);
lcd.clear();
break;
case IR_REMOTE_POWER:
lcd.print("You turn me on...");
delay(3000);
lcd.clear();
break;
case IR_REMOTE_VOLUP:
lcd.print("LOUDER");
delay(3000);
lcd.clear();
break;
case IR_REMOTE_FUNSTOP:
lcd.print("Why stop my fun?");
delay(3000);
lcd.clear();
break;
case IR_REMOTE_REWIND:
lcd.print("Beep beep, reversing!");
delay(3000);
lcd.clear();
break;
case IR_REMOTE_PLAYPAUSE:
lcd.print("PLAY/PAUSE idk which you want");
delay(3000);
lcd.clear();
break;
case IR_REMOTE_FASTFORWARD:
lcd.print("Nyoooom~");
delay(3000);
lcd.clear();
break;
case IR_REMOTE_DOWN:
lcd.print("Please, senpai, don't turn me down :(");
delay(3000);
lcd.clear();
break;
case IR_REMOTE_VOLDOWN:
lcd.print("Turn that shit down");
delay(3000);
lcd.clear();
break;
case IR_REMOTE_UP:
lcd.print("Reach up to the skies");
delay(3000);
lcd.clear();
break;
case IR_REMOTE_EQ:
lcd.print("No idea what this does");
delay(3000);
lcd.clear();
break;
case IR_REMOTE_STREPT:
lcd.print("Not a clue");
delay(3000);
lcd.clear();
break;
default:
lcd.print("The fuck you doing?");
delay(3000);
lcd.clear();
break;
}
IrReceiver.resume();
}
}