hi,
On ESP32 TTGO like below to print number or text, the the printing start at de defined position X and Y. (start to print from left)
when print a number, it could be good to justify it a right and clear the previous characters. May be there is way ?
I tried these 2 ways but not good and difficult to manage well the offset and can not remove the previous first digit!
1- do not use offset , the problem is that numbers are printed from left to right and previous last digit still on display
2- Print of 9999 in green at X and Y position then print 999 in orange at X+offset and Y position. Previous fist digit "9" in green is still on the display too
Do you have a way to solve that? ( cleardisplay is not nice)
thx for your prompt reply
Print new number on screen and removing previous characters
-
- Posts: 206
- http://meble-kuchenne.info.pl
- Joined: Thu Sep 23, 2021 3:44 pm
- Location: France
- Has thanked: 34 times
- Been thanked: 25 times
-
- Valued Contributor
- Posts: 1002
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 191 times
- Been thanked: 217 times
Re: Print new number on screen and removing previous characters
Hi lucibel
I wrote a macro for leading space or leading zero in the AppDevelopper.
As a suggestion for number of char: (3)for byte, (5)for uinteger, (6)for sinteger, (10)for ulong, (11)for slong
Maybe it help a little
regards
Stefan
I wrote a macro for leading space or leading zero in the AppDevelopper.
As a suggestion for number of char: (3)for byte, (5)for uinteger, (6)for sinteger, (10)for ulong, (11)for slong
Maybe it help a little
regards
Stefan
-
- Posts: 206
- Joined: Thu Sep 23, 2021 3:44 pm
- Location: France
- Has thanked: 34 times
- Been thanked: 25 times
Re: Print new number on screen and removing previous characters
Hi my data are currently numbers right now.
if more than 999 then add a space to the string.
It work well and was easy to do.
Thx LeighM
So I used ToString$ then checked if number is more or less than 999 .
if more than 999 then add a space to the string.
It work well and was easy to do.
Thx LeighM
Last edited by Xbiotec on Fri Dec 24, 2021 1:18 pm, edited 2 times in total.
Seb
-
- Posts: 206
- Joined: Thu Sep 23, 2021 3:44 pm
- Location: France
- Has thanked: 34 times
- Been thanked: 25 times
Re: Print new number on screen and removing previous characters
Hi,
I can not send you the complete one who include EEPROM,webserver, networkcom,WLAN, 2 circularbuffers, 2 UARTS, RTC...
So I will send you a simple flowchart.
I can not send you the complete one who include EEPROM,webserver, networkcom,WLAN, 2 circularbuffers, 2 UARTS, RTC...
So I will send you a simple flowchart.
Seb