In SX Microcontrollers, SX/B Compiler and SX-Key Tool, JonnyMac wrote: I'm not sure if this will help you, Eric, but I created a function called GET_BIT for my March N&V column that lets me extract a bit from any byte -- you could certainly pass the port (RB or RC) and bit position to this function and get a 1 or 0 back. [code] ' Use: result = GET_BIT value, position ' -- returns 1 or 0 GET_BIT: tmpB1 = __PARAM1 ' save value tmpB2 = __PARAM2 ' save position tmpB2 = 1 << tmpB2 ' create mask tmpB1 = tmpB1 & tmpB2 ' isolate bit IF tmpB1 > 0 THEN tmpB1 = 1 ENDIF RETURN tmpB1 [/code] ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=173886#m175419 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)