switch time delay with microcontroller

Status
Not open for further replies.

yassin.kraouch

Advanced Member level 2
Joined
Jul 5, 2009
Messages
631
Helped
40
Reputation
80
Reaction score
40
Trophy points
1,308
Activity points
5,094
Hi,
I have a push button, and i want to connect to a microcontroller, and i have two actions :
--long press
--short press
can i do this by only microcontroller and puch button ?
thanks
 

Yes. Connect Push button to an Interrupt pin (To avoid polling overhead). Start a timer upon interrupt. Use the timer value to determine whether it is a long/short press.
 

can the timer, count till 3 second ? and 5 second ?
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…