In SX Microcontrollers, SX/B Compiler and SX-Key Tool, TheBandit wrote: Thank you Paul. What is the [color=blue>"_"]"[/color][color=blue>WKED_B] and "WKEN_B = %1111_1110"[/color]? So if I connected a momentary, NO pushbutton with +5 to the RB.0 pin and used the following code, I could put the SX into sleep by pushing the button and it would wake up after getting a rising edge from RA.0? [code]Pushbutton VAR RA.0 Yes CON 1 Start: WKED_B = %1111_1110 WKPND_B = 0 WKEN_B = %1111_1110 Main: IF Pushbutton=Yes THEN SLEEP ENDIF [/code] How could I modify this so that accidentally pushing the button without holding it for a period of time wont accidentally turn off the device? I was thinking of using a a pause like this: [code] IF Pushbutton=Yes THEN PAUSE 100 IF Pushbutton=Yes THEN SLEEP ENDIF ENDIF [/code] Thank you again for your help! ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=276305#m276533 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2008 (http://www.dotNetBB.com)