Hello!
I'm a beginner. I don't know much when it comes to libraries/updates etc.
So my code was working as intended a couple of weeks back. Today I uploaded it back to my Arduino and it's not working as intended. I suspected that I may have updated my libraries which caused the issue but the issue remained even tho I deleted the new update.
The code is supposed to work like this:
I press 1 "0xFF30CF" on my remote--> "EQ led pin 2" Lights up and it waits for my input on the remote using a while loop
The problem is it only goes through the while loop once and then it just gets stuck i know that because it only prints "Waiting for input, press EQ to go back." one time(without my input).
type or paste code here
if (cmd.value == 0xFF30CF) {
while (inputled1 == false) {
while (IR.decode(&cmd) == 0) {
// It Gets stuck here it does not detect ir signals
}
IR.decode(&cmd);
Serial.println("");
Serial.println("Waiting for input, press EQ to go back.");
if (cmd.value == 0xFFE01F) {
myComred = "vol-";
redbrightness = redbrightness - 51;
Serial.println(myComred);
//Serial.println("");
Serial.print("Volume : ");
//Serial.println("");
}
if (cmd.value == 0xFFA857) {
myComred = "vol+";
redbrightness = redbrightness + 51;
Serial.println(myComred);
//Serial.println("");
Serial.print("Volume : ");
//Serial.println("");
}
if (cmd.value == 0xFF906F) {
myComred = "EQ";
inputled1 = true;
Serial.println(myComred);
}
if (cmd.value == 0xFF629D) {
myComred = "pwr";
if (redbrightness > 0) {
redbrightness = 0;
ledison = false;
Serial.println("powered off.");
}
else {
redbrightness = 255;
ledison == true;
Serial.println("powered on.");
}
//Serial.println(myComred);
}
//Serial.println(cmd.value, HEX);
delay(50);
IR.resume();
if (redbrightness > 255) redbrightness = 255;
if (redbrightness < 0) redbrightness = 0;
analogWrite(redled, redbrightness);
Serial.print(redbrightness);
delay(100);
digitalWrite(EQled, HIGH);
}
digitalWrite(EQled, LOW);
delay(100);
Serial.println(cmd.value, HEX);
Serial.println("out");
IR.resume();
}
inputled1 = false;
Thanks