Hello mods and Flowcode experts
I was wondering if there was any solution to the problem that bytes dose not tolerate decimal points in calculations.
The problem im facing is quite simple i got a variable [var = var + 0.5] and i want to show the var value on a LCD.
Thanks before hand.
Regard Michael
How to show decimal points on a LCD
Moderator: Benj
-
- Posts: 1314
- Joined: Sun Jan 15, 2012 3:15 pm
- Has thanked: 474 times
- Been thanked: 458 times
- Contact:
Re: How to show decimal points on a LCD
Hi
Havent got much time so made a simple chart for you , create varialble as a Float, then use float to string to print string to lcd
let me know if it works
Regards
Dazz
Havent got much time so made a simple chart for you , create varialble as a Float, then use float to string to print string to lcd
let me know if it works
Regards
Dazz
- Attachments
-
- flt to str exmp.fcf
- (5.5 KiB) Downloaded 346 times
To sign up to the V5 forum follow this link http://www.matrixmultimedia.com/forum_upgrades.php
-
- Posts: 13
- Joined: Mon Feb 04, 2013 12:05 pm
- Has thanked: 4 times
- Been thanked: 1 time
- Contact:
Re: How to show decimal points on a LCD
Thank you Dazz
It worked perfectly once again
Regards Michael
It worked perfectly once again
Regards Michael
-
- Posts: 1314
- Joined: Sun Jan 15, 2012 3:15 pm
- Has thanked: 474 times
- Been thanked: 458 times
- Contact:
Re: How to show decimal points on a LCD
glad it worked
To sign up to the V5 forum follow this link http://www.matrixmultimedia.com/forum_upgrades.php
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: How to show decimal points on a LCD
Hi Michael,
Attached is another flowchart to play with.
It's a bit more complex, but it allows you to alter at the beginning how many decimal places you require.
I believe there is a slight bug with V4 causing rounding to be simulated only. Will not round on hardware.
Works just fine on Flowcode V5 .
Martin
Attached is another flowchart to play with.
It's a bit more complex, but it allows you to alter at the beginning how many decimal places you require.
I believe there is a slight bug with V4 causing rounding to be simulated only. Will not round on hardware.
Works just fine on Flowcode V5 .
Martin
- Attachments
-
- flt to str exmp V1 With Rounding.fcf
- (7.5 KiB) Downloaded 321 times
Martin
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
- Contact:
Re: How to show decimal points on a LCD
Hi
Although I believe to deal with decimal numbers floating point and in LCD float2str is useful. But for only one or two decimal place addition and adding decimal number with byte, I must recommend normal arithmetic operation than using Float as that uses huge memory and really slow.
Rather I have put an example to show any number with one decimal point can be easily managed with addition and decision.
Although I believe to deal with decimal numbers floating point and in LCD float2str is useful. But for only one or two decimal place addition and adding decimal number with byte, I must recommend normal arithmetic operation than using Float as that uses huge memory and really slow.
Rather I have put an example to show any number with one decimal point can be easily managed with addition and decision.
- Attachments
-
- decimal_pt_dis_v4.fcf
- (8 KiB) Downloaded 326 times
-
- Posts: 13
- Joined: Mon Feb 04, 2013 12:05 pm
- Has thanked: 4 times
- Been thanked: 1 time
- Contact:
Re: How to show decimal points on a LCD
Hi guys
Thanks for the reply's
I was wondering what were the advantage of those 2 programs over the simple program dazz made? (I need to show 0.5,1,1.5,2,2.5,3.....)
And i got one more thing when i simulate it, it works but when i send it to the chip it wont show the decimal value eg (1.0,1.0,2.0,2.0,3.0.....)
Why is that and what can i do about im using an ATmega8-16pu.
Regards Michael
Thanks for the reply's
I was wondering what were the advantage of those 2 programs over the simple program dazz made? (I need to show 0.5,1,1.5,2,2.5,3.....)
And i got one more thing when i simulate it, it works but when i send it to the chip it wont show the decimal value eg (1.0,1.0,2.0,2.0,3.0.....)
Why is that and what can i do about im using an ATmega8-16pu.
Regards Michael
- Enamul
- Posts: 1772
- Joined: Mon Mar 05, 2012 11:34 pm
- Location: Nottingham, UK
- Has thanked: 271 times
- Been thanked: 814 times
- Contact:
Re: How to show decimal points on a LCD
I have mentioned the advantage in my last post..you can't accommodate float data manipulation in small memory chip.I was wondering what were the advantage of those 2 programs over the simple program dazz made? (I need to show 0.5,1,1.5,2,2.5,3.....)
Also this can happen if not done carefully. Can you please post your code so that we can see?And i got one more thing when i simulate it, it works but when i send it to the chip it wont show the decimal value eg (1.0,1.0,2.0,2.0,3.0.....)
-
- Posts: 13
- Joined: Mon Feb 04, 2013 12:05 pm
- Has thanked: 4 times
- Been thanked: 1 time
- Contact:
Re: How to show decimal points on a LCD
Okay I apologize for the ignorance but im still trying to get the hang of it
But here is the program
Regards Michael
But here is the program
Regards Michael
- Attachments
-
- Eksamensprojekt -test-Power Failure Atmega 8.fcf_avr
- (26.87 KiB) Downloaded 289 times