Does this do what you want?
This looks like my code but with optimized if statements, is it not? I loaded it and it does not "denounce". Once the button is pressed, the LED turns on then immediately off again. It gets 1121798582, then 4294967295 milliseconds later.
My Remote repeats the same code continuously, as long as a button is pressed,
but sends a different code ( ^ 0x800 ), when the same button is pressed twice.
With this feature it's easy to
- either only act once on a longer press, by ignoring the same code until a different one shows up,
- or to act continuously, e.g. in a volume control, when the duration of the button press is reflected by a number of small increments.
I would not call it "debounce"...
Right, its definitely not a real denounce since it does not have physical contacts. I just used "debounce" to describe the problem since it acts the same. When I press a remote button, I get two codes simultaneously. I want to trigger a relay with it so I wanted the code to take a remote code and latch the relay on. Furthermore I wanted to unlatch the relay so I assumed the second code would work best. The problem is that its nearly impossible to enter the fist code without simultaneously entering the second code.
Thank you, I appreciate both of you for taking the time to respond.