Page 1 of 1

Ili9488 Print number string!

Posted: Fri Dec 23, 2022 9:26 am
by jgu1
Hi!

If I try to print a number (float) in the display I do not get any digit after the komma
The same if I try to convert from float to String and print the string.
same result if I read out the value Intgr and convert to string.

It work in LCD display.

Is there another way, please?

Br Jorgen

Re: Ili9488 Print number string!

Posted: Fri Dec 23, 2022 9:34 am
by Steve-Matrix
The code in your "AMPS" macro appears to be working and the "Amps" float variable is correctly being converted to a string and being displayed on the LCD. But this macro is never called in your program.

If you run the "AMPS" macro directly (using the dropdown underneath the "run/go" button then you will see this macro working correctly.

Re: Ili9488 Print number string!

Posted: Fri Dec 23, 2022 10:40 am
by medelec35
Hi.
Have made some small changes for you.
If you convert an integer to a string there will only be whole numbers.
The format you need is MyString = FloatToString$ (MyFloat,x)
Where x = required number of decimal places.
50A Custom Component.png
50A Custom Component.png (10.64 KiB) Viewed 1387 times
As you can see, if you enter a minor and a major value, more numbers will appear on the component scale.

Re: Ili9488 Print number string!

Posted: Fri Dec 23, 2022 1:02 pm
by jgu1
Hi Martin and Steve!

Ohh yes, now I see the ligth, and it work. Again thank“s to you both :D

Br Jorgen