How to print Float number on HD44780?

Use this section to discuss your embedded Flowcode projects.
Post Reply
Sergejs
Posts: 143
http://meble-kuchenne.info.pl
Joined: Tue Oct 19, 2021 9:31 am
Has thanked: 73 times
Been thanked: 5 times

How to print Float number on HD44780?

Post by Sergejs »

I can not find this option. Is it impossible?

BenR
Matrix Staff
Posts: 1739
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 440 times
Been thanked: 603 times

Re: How to print Float number on HD44780?

Post by BenR »

Hello,

The easiest way is to convert the float to a string and then print the string.

for example this would convert the float to a string with 2 decimal places.

StrVar = FloatToString$(FloatVar, 2)

Most if not all the LCD components should now have the PrintFloat macro, you might need to do a Help -> Library update and do a full component update to make sure you've got the latest versions of the LCD components.

If not then which specific component are you using and we can look into adding the function.

Sergejs
Posts: 143
Joined: Tue Oct 19, 2021 9:31 am
Has thanked: 73 times
Been thanked: 5 times

Re: How to print Float number on HD44780?

Post by Sergejs »

I will try to upgrade database now.

Sergejs
Posts: 143
Joined: Tue Oct 19, 2021 9:31 am
Has thanked: 73 times
Been thanked: 5 times

Re: How to print Float number on HD44780?

Post by Sergejs »

Nothing happen. I use component HD47780 via I2C converter with IC PCF8574

BenR
Matrix Staff
Posts: 1739
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 440 times
Been thanked: 603 times

Re: How to print Float number on HD44780?

Post by BenR »

Ok, I've been through and added the function for you now.

Please let us know if you have any problems.

Sergejs
Posts: 143
Joined: Tue Oct 19, 2021 9:31 am
Has thanked: 73 times
Been thanked: 5 times

Re: How to print Float number on HD44780?

Post by Sergejs »

Now all is good.

Post Reply