binary # output on i/o
zafh15a
Posts: 2
I would like to have a variable expressed as a binary # in parallel on the I/O pins. the variable will be incremented or decremented by user inputs. so I would like the var to be input as a decimal # but then expressed in a 1 byte output on pins
ex:
user inputs··· 1
outputs go
················· 0-0
················· 1-0
··················2-0
··················3-0
··················4-0
················· 5-0
··················6-0
················· 7-1
I can do all of this with lookup table but at the expense of memory. Will the stamp perform this function thru its command set for me somehow.
·
ex:
user inputs··· 1
outputs go
················· 0-0
················· 1-0
··················2-0
··················3-0
··················4-0
················· 5-0
··················6-0
················· 7-1
I can do all of this with lookup table but at the expense of memory. Will the stamp perform this function thru its command set for me somehow.
·
Comments
VAR BYTE yourNumber
out0 = yourNumber.bit7
out1 = yourNUmber.bit6
out2 = yourNUmber.bit5
out3 = yourNUmber.bit4
out4 = yourNUmber.bit3
out5 = yourNUmber.bit2
out6 = yourNUmber.bit1
out7 = yourNUmber.bit0
Or something like that...
Rich H
OUTA=3· would result in 0011 on P0 to P3
Jeff T.