In SX Microcontrollers, SX/B Compiler and SX-Key Tool, datacps wrote: I am trying to change my pause time with an encoder. I need to flash and LED with a variable pause time of 1 to 1000 ms. I think I need to use an interupt but I don't know how to scale the encoder to adjust the pause delay . In BS2 it uses */ and the off set but that was with RCTIME. I am a total newbie to the sx . I looked at the best threads and examples but did not find or may have over looked the answer. DO PAUSEUS 500 UpdateEncoders delay = tmpw1 DO ' calculate on timing ??????? delay = 10 */ 255 HIGH led ' LED on pause delay ' pause 1 to 1000 ms LOW led ' LED off pause delay HIGH led2 ' LED on pause delay ' pause 1 to 1000 ms LOW led2 ' LED off pause delay LOOP FUNC GetEncoder1 tmpW1 = EncoderPort AND 3 RETURN tmpw1 ENDFUNC SUB UpdateEncoders encoder1 = GetEncoder1 IF encoder1 <> encoder1Last THEN IF encoder1 = 3 THEN IF encoder1Last = 1 THEN delay = delay + 1 delay = delay MAX Highestdelay ELSEIF encoder1Last = 2 THEN delay = delay - 1 delay = delay MIN mindelay ENDIF ENDIF encoder1Last = encoder1 ENDIF '''''''''''''''''''''''''''''' ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=226156 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)