In SX Microcontrollers, SX/B Compiler and SX-Key Tool, capdiamont wrote: maybe another way to do it, is to have the main loop check the buttons, then gosub to your loops? NOTE this isn't actual code main: if btn_a = 1 then mode = mode+1 if btn_b = 1 then goto THEEND if mode => maxmode then mode=0 if mode = 0 gosub loopa if mode = 1 gosub loopb if mode = 2 gosub loopc goto main loopa: turn output on return loopb: if delaytemp = maxdelay then toggle output if delaytemp = maxdelay then delaytemp = 0 delaytemp = delaytemp + 1 return etc ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=204267#m204907 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2007 (http://www.dotNetBB.com)