If it's 32 bit then it needs to be long or unsigned long as int is only 16 bits. Maybe this is the problem?
[/quote]
oh, I thought int was 32 bit. I did change to unsigned long but it's still behaving same way.
press and hold is behaving as single button press.
single button press behaves as press and hold.