PDA

View Full Version : How do I display binary on an LCD?



kitcat
- 2nd March 2005, 12:32
Hi there.
I can send a number to my lcd display like this:
serout portc.0,6,[#number]
and it shows up as a nice decimal number.
What I want to be able to do is display it so it looks like this 01011010.

if I just send this: serout portc.0,6,[number] it comes up as some nonsense character.
I was expecting to be able to send this:
serout portc.0,6,[%number]
but it ain't having it. Bad token or some such thin.

Can anyone help?

thanks

rastan
- 2nd March 2005, 13:25
serout doesnt support modifiers, you will have to use serout2. gives you more control anyway.
then you can just use

Modifier Operation
{I}{S}BIN{1..16} Send binary digits
{I}{S}DEC{1..5} Send decimal digits
{I}{S}HEX{1..4} Send hexadecimal digits
REP c\n Send character c repeated n times
STR ArrayVar{\n} Send string of n characters

vuala.

phil