In SX Microcontrollers, SX/B Compiler and SX-Key Tool, DosManDan wrote: I have run across something similar, so I hope this is the right fix... Your code is fine, the problem is the SX is faster than you... In your code, you turn the alarm on when the button is pushed, then you loop to wait for a debounce. Your wait is to short and in the process of debounce it comes out of the loop. As a test, remove the GOTO MainLoop at the bottom and see if the light stays on. I expect that it will be. To fix it, increase your PAUSE inside the loop to 700. Also, just from the small bit of code you gave, it looks like you could just directly toggle o_alarmtriac and skip using alarm_enabled. Let me know if this fixes it! Dan ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=394263#m394776 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)