This code is working with my remote control but I need momentary output from pin 13.
according to this code when I press the proper remote key (0xb54a50af) the pin 13 is latching high and not going low until I press any other remote key .
All I need is until I'm pressing the proper remote key (0xb54a50af) pin 13 should go high and when I release it pin 13 should go low.
I checked the whole web but I couldn't find momentary on IR (arduino ) example code.
results.value will remain its value of 0xb54a50af until a new value is received. To turn off the LED change its value when there is no longer anything received.
Maybe this will do:
When pin 13 is set HIGH, start a timing sequence for a period you want.
When the period has been satisfied, set pin 13 LOW.
You can use the BWD (blink without delay) example in the IDE as a aid for the timing.
Edit
On second thought, you might be able to modify the library (a big job though).
As long as the repeat code comes in this signals your code to keep 13 high.
When the repeat code dissapears, you make led 13 low.
.
thank you for the code.i tried it and this works just the same as before not as momentary switch.it seems arduino is expecting an IR code valued like this ( results.value == 0x00000000;)
but i tried some AVR basic program in that your suggestion (results.value == 0x00000000;) works.but those programs don't have 32 bit NEC IR libraries.
I tried results.value=0x00000000 then arduino totally stopped responding to IR.
Im newly building a retro type amplifier, in that there is a motor assisted volume control .my main objective is for it to operate remotely(the motor) and operate 1 relay as a power on/off switch.
so I need 1 latching output for power on/off, and 2 momentarily outputs for move volume cont motor left/right, from arduino using IR remote.I have done the latching part from copying some source codes and it is working.But I need help for momentary outputs.
LarryD as you mentioned to (edit) modify the IR library,if i do that is it going to effect my latching output? :o
Most remotes send a different code when a switch is held down. You need to determine if yours does, and use that value to mean "repeat last action". Of course, this requires that you remember the last action.
Very sorry for not having the time to reach you all as i was stuck in the job..and thank you for all the replies...i have tried each and every instruction that everyone gave but as a newbie to programming and i am still stuck in the same place of the code...
Dear PaulS... i tried checking my remote controller with your last instruction and it has only one value..is there anything else i can do..i just need output momentarily on and off when i press and release the remote controller..please help..