I am using the X-1 board with a 16F877A PIC. Learning the LCD and have a question formatting the display of a three digit versus four digit number.
The first row of the LCD is just pretty much the header for the second row. The second row has numeric values. When the numeric values on the second line change from four to three digits, the rest of the second row shifts to the left one click. When this happens, the header row doesn't line up correctly with the second row. If there a way without using a bunch of 'IF' statements, I can format the second row to have each numeric value start in the same column? I wouldn't mind at all 900 looking like 0900. Here is the code I am using:
Lcdout $fe, 1 ' Clear screen
Lcdout "Stage Start End Prog"
If StageState = 0 then
Lcdout $fe, $c0,dec StageNum,"-S"," ",dec DisplaySTIme, " ",Dec DisplayETime
else
Lcdout $fe, $c0,dec StageNum,"-E"," ",dec DisplaySTIme, " ",Dec DisplayETime
endif
I tried using the following to display a leading 0 when a three digit number is used:
Lcdout $fe, 1 ' Clear screen
Lcdout "Stage Start End Prog"
If StageState = 0 then
Lcdout $fe, $c0,dec StageNum,"-S"," ",dec DisplaySTIme+0000, " ",Dec DisplayETime+0000
else
Lcdout $fe, $c0,dec StageNum,"-E"," ",dec DisplaySTIme+0000, " ",Dec DisplayETime+000
endif
That didn't work out. Any suggestions?
Also, I would like to underline 'Start' or 'End' in the header column at times. What is the command for underline?
Thanks
Toby
Bookmarks