Ili9488 Print number string!

For general Flowcode discussion that does not belong in the other sections.
Post Reply
jgu1
Posts: 813
http://meble-kuchenne.info.pl
Joined: Thu Dec 03, 2020 8:25 pm
Location: Denmark
Has thanked: 696 times
Been thanked: 183 times

Ili9488 Print number string!

Post 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
Attachments
To str.PNG
To str.PNG (29.8 KiB) Viewed 1388 times
NySolcelle.fcfx
(26.79 KiB) Downloaded 67 times

Steve-Matrix
Matrix Staff
Posts: 1557
Joined: Sat Dec 05, 2020 10:32 am
Has thanked: 214 times
Been thanked: 362 times

Re: Ili9488 Print number string!

Post 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.

medelec35
Matrix Staff
Posts: 2088
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 645 times
Been thanked: 703 times

Re: Ili9488 Print number string!

Post 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 1383 times
As you can see, if you enter a minor and a major value, more numbers will appear on the component scale.
Attachments
NySolcelle v2.fcfx
(27.08 KiB) Downloaded 67 times
Martin

jgu1
Posts: 813
Joined: Thu Dec 03, 2020 8:25 pm
Location: Denmark
Has thanked: 696 times
Been thanked: 183 times

Re: Ili9488 Print number string!

Post 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

Post Reply