VS838 IR receiver led anyone got it working with mys?
-
So here is what I learned from all this....
Issue 1 - Was caused by the fact that IRsend was called at first boot - nothing wrong with that, but what I didn't know was that IRsend disables IR receive.
The solution was as simple as adding one more line to that section of code as follows.....if (newcodeRX == 1 || lightrequest == 1) { irsend.sendNEC(INcode, 32); newcodeRX = 0; lightrequest = 0; irrecv.enableIRIn(); // Start the receiver }This re-enables the receiver and then all is working as expected!
As for the second issue......Well, I'll just post the code for anyone interested.....
if (irrecv.decode(&results)) { IRin = results.value,HEX; if (IRin == 0xFFA25D) { lights = 1; Serial.print("Lights ON... "); } if (IRin == 0xFFE21D) { lights = 0; Serial.print("Lights OFF... "); } if (lights != last_lights) { saveState(10, lights); send(msgLights.set(lights)); last_lights = lights; } irrecv.resume(); // Receive the next value }It's always soooooo easy when you know how! ;)
Onwards and upwards! :)
-
So here is what I learned from all this....
Issue 1 - Was caused by the fact that IRsend was called at first boot - nothing wrong with that, but what I didn't know was that IRsend disables IR receive.
The solution was as simple as adding one more line to that section of code as follows.....if (newcodeRX == 1 || lightrequest == 1) { irsend.sendNEC(INcode, 32); newcodeRX = 0; lightrequest = 0; irrecv.enableIRIn(); // Start the receiver }This re-enables the receiver and then all is working as expected!
As for the second issue......Well, I'll just post the code for anyone interested.....
if (irrecv.decode(&results)) { IRin = results.value,HEX; if (IRin == 0xFFA25D) { lights = 1; Serial.print("Lights ON... "); } if (IRin == 0xFFE21D) { lights = 0; Serial.print("Lights OFF... "); } if (lights != last_lights) { saveState(10, lights); send(msgLights.set(lights)); last_lights = lights; } irrecv.resume(); // Receive the next value }It's always soooooo easy when you know how! ;)
Onwards and upwards! :)