View previous topic :: View next topic |
Author |
Message |
Sid2286
Joined: 12 Aug 2010 Posts: 119
|
Using push button for On/Off |
Posted: Tue Feb 15, 2011 3:10 am |
|
|
Hi,
I was wondering how to use a push button for On and Off Application. Just like how it is in laptops or computers.
i'm out of ideas...please help...I don't want to use a slide switch.
Regards,
Sid |
|
|
SherpaDoug
Joined: 07 Sep 2003 Posts: 1640 Location: Cape Cod Mass USA
|
|
Posted: Tue Feb 15, 2011 6:58 am |
|
|
Keep track of the current state, either On or Off. When the button is pressed, and the press is qualified by whatever switch debouncing* you choose to use, change the current state to the other state.
* Note that mechanical switches tend to bounce when pressed and give a quick series of switch closures. One simple debouncing method would be to sense the switch close, then wait 10ms and see if the switch is still closed before deciding this is a single valid switch closure. _________________ The search for better is endless. Instead simply find very good and get the job done. |
|
|
John P
Joined: 17 Sep 2003 Posts: 331
|
|
Posted: Tue Feb 15, 2011 8:23 am |
|
|
I'm assuming that you're asking about a circuit where you could turn a system on with a pushbutton, then turn it off again with the same button. This doesn't do exactly that, but it does allow a processor to control its own power. You could easily add an "off" button to the processor, telling it to kill its own power, or you could add circuitry to monitor the "on" button so if it's held for 5 seconds, that would also tell the processor to kill power, once the button is released. The circuit is designed to be mounted in a hand-held box where conductivity through the user's skin would turn power on, so it's sensitive to low currents.
|
|
|
|