I'm trying to implement a logic to detect a keypress and hold from a RF remote. Currently I'm able to detect the button press in my controller RF receiver. I'm getting the interrupt callback for every press. Now how do I detect a press and hold for 5 sec in the code?
I checked in the oscilloscope that when I press and hold a key in remote, I get the RF data in my receiver every 34ms.
All I can think of is to count the number of sequential interrupts with the same data in 5 secs and validate it but I'm not sure its the right way.
Any suggestions how to implement it. I will try it.
Thanks