In SX Microcontrollers, SX/B Compiler and SX-Key Tool, bean wrote: Alex, You cannot use a variable for the bit position. This is because of the way the SX instructions are formed. Probably the easiest way is to do this: [code] OUTPUT RB ' Make all bits of RB outputs FOR idx = 0 to 7 tempByte = 1 << idx ' Get a 1 in the position to turn on RB = RB OR tempByte ' Make pin high NEXT [/code] Bean. ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=138451#m138468 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2006 (http://www.dotNetBB.com)