Hello all, I am looking to use two labels for a case function - so that two separate IR remote HEX's can trigger the same function , I have tried "or" and "||" without any luck. Is this possible? I cannot simply add another case as it is nested in a "else"/"else if" case at the end of my switch.
case 0x76A77416 || 0x169E8AEE:
if (v >= 5){
pausev = v;
delay(100);
v = 0;
lcd.setCursor(55, 0);
lcd.setFontSize(FONT_SIZE_MEDIUM);
lcd.setCursor(55, 0);
lcd.println(" ");
lcd.setCursor(55, 0);
lcd.println("P CENTER");
}
else if (v < 5){
v = 0x76A77416 || 0x169E8AEE;
delay(100);
lcd.setCursor(55, 0);
lcd.setFontSize(FONT_SIZE_MEDIUM);
lcd.setCursor(55, 0);
lcd.println(" ");
lcd.setCursor(70, 0);
lcd.println(bpm);
lcd.setCursor(110, 0);
lcd.println("<>");
in your code 0x76A77416 || 0x169E8AEE is a boolean logic expression.
As anything non null is true, you are doing true || true which is true. As the switch case expects a integral value, then this value is promoted to its integral representation which is 1 so it's like you had written
Thank you all, I think I understand why it does not work now but I fail to understand if and how it can work. I am not an expert in this area (as I am sure you correctly guessed:), I do appreciate your help understanding the problem.
I just ran IR_Receive_Demo_3.1 to double check the hex, I get this error for only this remote button:
Space between two detected transmission is greater than 5000 but smaller than the minimal gap of 20000 known for a protocol.
Try to increase the RECORD_GAP_MICROS in IRremote.h.
I had to step out for a few minutes. It looks like the button in question needs a RECORD_GAP_MICROS setting of 15000 - which is way too high for the other buttons to work. This planned function was very minor, so I am just going to omit it, it's probably not worth what it may take to resolve this - if it even can be with my knowledge. Thank you all for your help, we did find the problems:). -Travis