string input LOOKUP
deans
Posts: 9
Hello everybody,
I am trying to use LOOKUP to display a set of characters received over serial port on a 7-segment LED.
The string is received but LOOKUP seems not to be operating correctly on the string.
The characters are not displayed correctly, I can see from the DEBUG feedback that the LOOKUP does not ouput the values from the table.
Can anybody tell me what this is? A matter of formatting the input differently? But then how?
Below you can find the sample code from the exercises that I expanded to attempt to do what I would like to do...
Sincerely
Dean
' {$STAMP BS2}
' {$PBASIC 2.5}
serStr VAR BYTE(5)
SERIN 16, 16468, [STR serStr\5]
' Patterns of 7-Segment Display to create letters
A CON %11110101
b CON %00110111
C CON %01100011
d CON %10010111
E CON %01110011
F CON %01110001
H CON %10110101
I CON %00100001
n CON %00010101
p CON %11110001
r CON %00010001
S CON %01110110
t CON %00110011
_ CON %00000000
OUTH = %00000000
DIRH = %11111111
index VAR BYTE
DO
DEBUG "index OUTH ", CR,
"
", CR
FOR index = 0 TO 4
LOOKUP 0, [serStr(index)], OUTH
DEBUG " ", DEC2 index, " ", BIN8 OUTH, " ", serStr(index), CR
PAUSE 400
NEXT
PAUSE 2000
LOOP
I am trying to use LOOKUP to display a set of characters received over serial port on a 7-segment LED.
The string is received but LOOKUP seems not to be operating correctly on the string.
The characters are not displayed correctly, I can see from the DEBUG feedback that the LOOKUP does not ouput the values from the table.
Can anybody tell me what this is? A matter of formatting the input differently? But then how?
Below you can find the sample code from the exercises that I expanded to attempt to do what I would like to do...
Sincerely
Dean
' {$STAMP BS2}
' {$PBASIC 2.5}
serStr VAR BYTE(5)
SERIN 16, 16468, [STR serStr\5]
' Patterns of 7-Segment Display to create letters
A CON %11110101
b CON %00110111
C CON %01100011
d CON %10010111
E CON %01110011
F CON %01110001
H CON %10110101
I CON %00100001
n CON %00010101
p CON %11110001
r CON %00010001
S CON %01110110
t CON %00110011
_ CON %00000000
OUTH = %00000000
DIRH = %11111111
index VAR BYTE
DO
DEBUG "index OUTH ", CR,
"
", CR
FOR index = 0 TO 4
LOOKUP 0, [serStr(index)], OUTH
DEBUG " ", DEC2 index, " ", BIN8 OUTH, " ", serStr(index), CR
PAUSE 400
NEXT
PAUSE 2000
LOOP
Comments
Jeff T.