PDA

View Full Version : Display binary with LCD out



pinbender
- 4th December 2008, 18:05
I'm a new user of PBP and have been playing with the LCDOUT instruction.
Is there a simple way to display a variable as binary instead of the numeric ASCII value? I'm moving bits around and would like to see the results directly.

BTW This is my firsting posting to the forum.
Thanks in advance,
Bob B.

fronkensteen
- 4th December 2008, 18:12
Look through the LCDOUT section in your manual for the keyword BIN, specifically BIN8.

Melanie
- 4th December 2008, 18:17
Hi and Welcome

Assuming your variable is called MyByte...

LCDOUT $FE,1,BIN8 MyByte

Will clear the LCD, locate to Column 1, Line 1 and display all eight bits of MyByte.

ie... if MyByte=65, the LCD will show 01000001

Look in the SEROUT2 section of your manual... BINx can be any number from 1 to 16, so you can display a whole word with LCDOUT BIN16 MyWord.

See also the HEX and DEC modifiers whilst you're there...

pinbender
- 4th December 2008, 20:38
OH, That part of the manual :o
Thanks much,
Bob B.