In SX Microcontrollers, SX/B Compiler and SX-Key Tool, JonnyMac wrote: Laura: Printing binary values is deceptively easy -- here's one that will print all eight bits (use with __MSB and __LSB to print words in binary). [code]' Use: TX_BIN8 value ' -- prints value in BIN8 format SUB TX_BIN8 binOut VAR tmpB1 ' value to print binIdx VAR tmpB2 ' bit index binOut = __PARAM1 ' capture value FOR binIdx = 1 TO 8 ' print 8 chars __PARAM1 = "0" + binOut.7 ' convert bit7 to ASCII TX_BYTE __PARAM1 ' print it binOut = binOut << 1 ' shift to get next bit NEXT ENDSUB[/code] ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=330128#m330970 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)