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! :)
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login