Hi
I have no problems reading the uint from Lut2.
Cannot read the floats from Lut1 for some reason.
Any help please?
FC11 Read float fr LUT err (Solved)
-
viktor_aust
- Posts: 2
- http://meble-kuchenne.info.pl
- Joined: Fri May 17, 2024 1:04 am
- Has thanked: 2 times
FC11 Read float fr LUT err (Solved)
- Attachments
-
- FC11_Mega+Lut_fl_err.fcfx
- (18.82 KiB) Downloaded 10 times
Last edited by viktor_aust on Mon Jan 05, 2026 8:55 pm, edited 1 time in total.
-
chipfryer27
- Valued Contributor
- Posts: 1806
- Joined: Thu Dec 03, 2020 10:57 am
- Has thanked: 403 times
- Been thanked: 621 times
Re: FC11 Read float fr LUT problems
Hi
Appears to run OK in v10
In v11 the float lut states 4 values, but in v10 it states 5
Regards
Appears to run OK in v10
In v11 the float lut states 4 values, but in v10 it states 5
Regards
-
BenR
- Matrix Staff
- Posts: 2057
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 545 times
- Been thanked: 731 times
Re: FC11 Read float fr LUT problems
Hello,
Aha I see the problem, we made a massive efficiency boost for v11 where the byte values for the LUT are now parsed by the flowcode engine directly rather then having to get it as a string and have to manually crunch through the string in an event macro. This doesn't make much of a difference for small LUT data but for things like the GLCD where you have potentially big fonts and up to 8 of them which was causing significant slowdown on project launch and simulation start.
I'll see if I can make an exception for floats so they use the old parsing system.
Aha I see the problem, we made a massive efficiency boost for v11 where the byte values for the LUT are now parsed by the flowcode engine directly rather then having to get it as a string and have to manually crunch through the string in an event macro. This doesn't make much of a difference for small LUT data but for things like the GLCD where you have potentially big fonts and up to 8 of them which was causing significant slowdown on project launch and simulation start.
I'll see if I can make an exception for floats so they use the old parsing system.
Regards Ben Rowland - MatrixTSL
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
-
BenR
- Matrix Staff
- Posts: 2057
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 545 times
- Been thanked: 731 times
Re: FC11 Read float fr LUT problems
Hopefully resolved for you now via the library updates.
Regards Ben Rowland - MatrixTSL
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
-
viktor_aust
- Posts: 2
- Joined: Fri May 17, 2024 1:04 am
- Has thanked: 2 times
Re: FC11 Read float fr LUT problems
Thank you Ben. All good. Works now.
Floats and Atmega328 question.
Is it a good idea to use floats with Ard Nano?
I can use uint and insert the dot later on (to mimic the float).
Will it ease the load on Atmega328 and save the space in the memory if I stay away from the floats?
Floats and Atmega328 question.
Is it a good idea to use floats with Ard Nano?
I can use uint and insert the dot later on (to mimic the float).
Will it ease the load on Atmega328 and save the space in the memory if I stay away from the floats?
-
mnfisher
- Valued Contributor
- Posts: 1773
- Joined: Wed Dec 09, 2020 9:37 pm
- Has thanked: 148 times
- Been thanked: 836 times
Re: FC11 Read float fr LUT err (Solved)
I'd try and avoid floats whenever possible especially on a 8 bit MCU.
With an 8bit MCU - with no floating point hardware - it's always going to be a lot slower than integer maths. A float variable is 32bits (as for a long) - so might not use more storgae so in a similar vein - always use the smallest variable type that will 'fit' the data - if you look at the code generated for adding a 16 or 32 bit number compared to adding an 8 bit variable - then things get bigger and slower. Just be sure you aren't going to overflow - a common mistake - a loop 256 times using a byte
(all been there!)
Of course it depends what you are trying to do - if you can use fixed point numbers by multiplying values by, say, 100 - then it will be quicker - but if you need trig functions or bigger range then the trade off might be worthwhile. Also bear in mind that some values can't be represented exactly by floats - so sometimes care is needed with comparisons (if .x == 0.1).
Martin
With an 8bit MCU - with no floating point hardware - it's always going to be a lot slower than integer maths. A float variable is 32bits (as for a long) - so might not use more storgae so in a similar vein - always use the smallest variable type that will 'fit' the data - if you look at the code generated for adding a 16 or 32 bit number compared to adding an 8 bit variable - then things get bigger and slower. Just be sure you aren't going to overflow - a common mistake - a loop 256 times using a byte
Of course it depends what you are trying to do - if you can use fixed point numbers by multiplying values by, say, 100 - then it will be quicker - but if you need trig functions or bigger range then the trade off might be worthwhile. Also bear in mind that some values can't be represented exactly by floats - so sometimes care is needed with comparisons (if .x == 0.1).
Martin