Page 1 of 1

gLCD ST7565R1

Posted: Fri Jan 26, 2018 12:14 pm
by Boomer
Hi Guys

I have created a small program with the above LCD Display.
Capture.PNG
(13.49 KiB) Downloaded 988 times

As can be seen there is two readings 001 and 0.

If the number value goes above 100 the digits don't align on the decreasing value.

ie the number 1 stays in the hundred's column.

any ideas how I can change this without clearing the screen completely

Best Regards

Ian

Re: gLCD ST7565R1

Posted: Fri Jan 26, 2018 1:03 pm
by Benj
Hi Ian,

Before printing your number you need to make a decision if the number is less than 10 and less than 100. If it is then print out some padding 0's.

Here is some pseudo code.

if (number < 100)
PrintString ("0")
if (number < 10)
PrintString ("0")

PrintNumber (number)

Hope this helps.

Re: gLCD ST7565R1

Posted: Sat Jan 27, 2018 6:47 am
by Boomer
Thanks a bunch Benj, got it now

Appreciate your help

Ian