Lcd problem
grkblood13
Posts: 31
ok, this is one section of a much larger code. but for my purpose of showing you what i'm doing this is all thats needed. all that i want to do is display "total", all my LCD is doing though is displaying a "\". please help, what am i doing wrong???·also, im using P15 to communicate with the LCD.
' {$STAMP BS2p}
' {$PBASIC 2.5}
location CON 0
i VAR Nib
total VAR Word
DO
PAUSE 1000······················ 'delay to compensate for time to get on scale'
total = 0
FOR i = 1 TO 15
total = total + (INS & $01FF)
PAUSE 100························ 'this delay is because the converter is running at 10 Hz'
NEXT
total = total / 15
WRITE location,total
DEBUG DEC total
SEROUT OUT15,16468,[noparse][[/noparse]DEC total]
LOOP
' {$STAMP BS2p}
' {$PBASIC 2.5}
location CON 0
i VAR Nib
total VAR Word
DO
PAUSE 1000······················ 'delay to compensate for time to get on scale'
total = 0
FOR i = 1 TO 15
total = total + (INS & $01FF)
PAUSE 100························ 'this delay is because the converter is running at 10 Hz'
NEXT
total = total / 15
WRITE location,total
DEBUG DEC total
SEROUT OUT15,16468,[noparse][[/noparse]DEC total]
LOOP
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Andy Lindsay
Education Department
Parallax, Inc.
, but total is usually around 510, so i dont understand why it wont display the value 510
Could it be the wrong BAUD rate? Have you tried other values like 240 in place of the 16468?
It would help to know the Make/Model of the LCD. The baud parameter you used is for inverted baud mode. Are you sure the LCD uses inverted mode? Are there jumpers to set the baud rate on the display? Do they match the speed (9600 bps) you chose? Your Stamp Directive indicates a BS2p and the baud rate value for 9600 bps inverted on that is 16624. Take care.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
Thus, 16468 will get you "Inverted", 9600 baud on a BS2, BS2e, and BS2pe
BS2sx and BS2p need 16624 to get "Inverted", 9600 baud (or 240 for non-inverted, 9600 baud).
So, you're probably using the wrong "baudmode" value to get the baud rate you want. This is documented under the SEROUT keyword in the PBasic 'help' file.
serout 15,240,[noparse][[/noparse]CLS]
but apparently its not that easy.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Rick