??? 04/10/06 15:49 Modified: 04/10/06 15:50 Read: times |
#113980 - Yes Responding to: ???'s previous message |
Erik Malund said:
.. but the fun part of the design. I have solved it by the debounce timer loop setting a variable to zero on "new key" and, if a valid key exist, incrementing it if it is not zero. In the main loop inspecting said vartiable and, if it is zero it means Key pressed (long enough) act and set the variable to max - delay.
the above is brief, but you should get the drift. Erik Yes thats the most efficient way without wasting resources. I just implemented it and it did succeed. The only adition I added is reset the repeat flag only on key release, since my debounce function trigers on both edges. And guess what, it only took few lines of code to add. Impressive. Thank you Erik. Mahmood |
Topic | Author | Date |
LCD repeat function in C | 01/01/70 00:00 | |
First thought | 01/01/70 00:00 | |
if its roundrobin | 01/01/70 00:00 | |
last post | 01/01/70 00:00 | |
Sounds fine | 01/01/70 00:00 | |
the one issue | 01/01/70 00:00 | |
stuck key | 01/01/70 00:00 | |
Yes | 01/01/70 00:00 | |
Code Review | 01/01/70 00:00 | |
this must be excellent switches | 01/01/70 00:00 | |
excellent debounce for bad switches![]() | 01/01/70 00:00 | |
better code version | 01/01/70 00:00 | |
no comments, captals, no indenting | 01/01/70 00:00 | |
It could do with some improvement! | 01/01/70 00:00 | |
I did not comment on that, it may very w | 01/01/70 00:00 | |
true.... | 01/01/70 00:00 | |
led to so much misinformation in this fo | 01/01/70 00:00 |