Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
03/03/08 20:39
Read: times


 
#151832 - Interrupt
Responding to: ???'s previous message
Chris Bertrand said:
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.


Use an interrupt to measure time. The RTC tutorial in the Tutorials section uses this technique. It's written in assembly language but could be implemented just as easily in 'C'.

If the button is released before you get to the "second function" time threshold, you execute the momentary function. If your timer gets to the second function time threshold, you execute the second function without further delay.

Regards,
Craig Steiner


List of 9 messages in thread
TopicAuthorDate
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      

Back to Subject List