??? 03/03/08 20:23 Read: times |
#151831 - Dual function push button with timer in C? |
Typically most of my inputs have been a single function, you push the NO PB and it connects and transistions and the micro does the related call to that function.
Now I've been tasked with something a bit interesting, when I push the button/tap/less than 1/2 second, it should do a particular task, but if the same button is pressed and held for 2.5 seconds or more, another task without performing the momentary task. Assuming some type of if/else statement would be required, but since C doesn't a precise time or a code and see for timing, what would be a smart approach to this type of issue? Its not looking for edge triggering, only the "amount of time" the switch is press and held. Would I set a timer before the function entry or during the if part of the function. I just can't see it clearly and need a nudge if possible. If more is needed, please ask. Thanks Chris |
Topic | Author | Date |
Dual function push button with timer in C? | 01/01/70 00:00 | |
Interrupt | 01/01/70 00:00 | |
No answer just another question: | 01/01/70 00:00 | |
Nothing really, just those two functions. | 01/01/70 00:00 | |
Dual Switch | 01/01/70 00:00 | |
Ah yes....that will do | 01/01/70 00:00 | |
discussed here | 01/01/70 00:00 | |
Triple Function Even Possible | 01/01/70 00:00 | |
of course timer![]() | 01/01/70 00:00 |