How to display the the binary value of a variable on LEDs?
Jeena99
Posts: 14
I want 4 LEDs to display the value of a variable in binary.
Those LEDs are connected to P0 ,P1,P4,P5
Any Help Is appreciated.........Jeena
Those LEDs are connected to P0 ,P1,P4,P5
Any Help Is appreciated.........Jeena
Comments
It will be much easier if you can re-arrange things so your leds are on p0,p1,p2,p3 so that you can use the OUTA command. The command is made to do exactly what you're asking about.
If you must use the the pins you've noted, it can be done by using OUTA and OUTB with some masking and/or shifting of bits.
Have a look at the Editor's Help file under OUT.
Cheers,
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tom Sisk
http://www.siskconsult.com
·
PINS=B0
or
OUTL=B0
for 8 bits.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·"If you build it, they will come."