Display of VAR on LCD
bsparky
Posts: 52
How can I take a VAR apart and display it on an LCD. Short excerpt of my program.
'
Count
Counter:
SEROUT Lcd,Baud,[noparse][[/noparse]5,1,5,2,1,1,"Parts <---> Pieces"]
SEROUT Lcd,Baud,[noparse][[/noparse]3,3,(Parts+48),3,17,(Piece+48)]
Counter1:
DO WHILE Cnt = 0 'Cnt is PIN 3 when PIN 3 goes high count
LOOP
PAUSE 100
Piece = Piece + 1
SEROUT Lcd,Baud,[noparse][[/noparse]3,3,(Parts+48),3,17,(Piece+48)]
IF Piece = PieceCnt THEN PartCom
GOTO Counter1
This works until I reach greater then 10, because there is know ascii for that. I know I have take VAR Parts apart and diplay
it in two differant consecutive places on the LCD. Tried MSB and LSB and HIGHBIT and LOWBIT but could not get it to work.
Any thoughts ............ Thanks
'
Count
Counter:
SEROUT Lcd,Baud,[noparse][[/noparse]5,1,5,2,1,1,"Parts <---> Pieces"]
SEROUT Lcd,Baud,[noparse][[/noparse]3,3,(Parts+48),3,17,(Piece+48)]
Counter1:
DO WHILE Cnt = 0 'Cnt is PIN 3 when PIN 3 goes high count
LOOP
PAUSE 100
Piece = Piece + 1
SEROUT Lcd,Baud,[noparse][[/noparse]3,3,(Parts+48),3,17,(Piece+48)]
IF Piece = PieceCnt THEN PartCom
GOTO Counter1
This works until I reach greater then 10, because there is know ascii for that. I know I have take VAR Parts apart and diplay
it in two differant consecutive places on the LCD. Tried MSB and LSB and HIGHBIT and LOWBIT but could not get it to work.
Any thoughts ............ Thanks
Comments
This may help...
instead of· displaying··· parts+48
try················· DEC2 parts···· and remove the +48.
Read up on the DEC modifier in the help manual and I think you'll be onto it.
Cheers
Chris
'
Count
Counter:
SEROUT Lcd,Baud,[noparse][[/noparse]5,1,5,2,1,1,"Parts <---> Pieces"]
SEROUT Lcd,Baud,[noparse][[/noparse]3,3,(DEC2 Parts),3,17,(DEC2 Piece)]
Counter1:
DO WHILE Cnt = 0
LOOP
PAUSE 100
Piece = Piece + 1
SEROUT Lcd,Baud,[noparse][[/noparse]3,3,(DEC2 Parts),3,17,(DEC2 Piece)]
IF Piece = PieceCnt THEN PartCom
GOTO Counter1
Thanks for the reply.
Remove the parenthesis outside of the DEC expression like the following:
SEROUT Lcd, Baud, [noparse][[/noparse]3,3,DEC2 Parts,3,17,DEC2 Piece]
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
<!--StartFragment -->