Lookup Table Help
Gorilla
Posts: 16
I have 7 segment displays multiplexed common anode displays the 7 segs are connected to a 7447 bcd decoder. I wrote a look up table and the only way I can get it to work correctly is by typing the binary equivalent of the numbers i.e. %0111 for seven this takes time, what I really want to do is just type a 7 and then output the binary equiv OUTA.
' {$STAMP BS2p}
' {$PBASIC 2.5}
'====Main Program===
duration CON 500
charNum VAR Nib
DIRA=%11111111
DO
FOR charNum = 9 TO 0
LOOKUP charNum, [1,2,3,4,5,6,7,8,9],DIRA
PAUSE duration
NEXT
LOOP
' {$STAMP BS2p}
' {$PBASIC 2.5}
'====Main Program===
duration CON 500
charNum VAR Nib
DIRA=%11111111
DO
FOR charNum = 9 TO 0
LOOKUP charNum, [1,2,3,4,5,6,7,8,9],DIRA
PAUSE duration
NEXT
LOOP
Comments
You could just use OUTA=charNum, but I figured you needed/wanted help with LOOKUP