For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.
Moderator: Benj
Benj
Matrix Staff
Posts: 15312 Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:
Post
by Benj » Thu Mar 25, 2010 1:24 pm
Hi Wayne,
I have had a quick look at your program and the reason the code is not working correctly is due to things like this.
mph = ground_speed/0.44704
This would instead have to use the floating point functions.
float = fdiv(ground_speed, 0.044704)
If your ground speed variable in an integer or a byte then you will first have to convert it to a float.
fgnd_sp = int2float(ground_speed)
float = fdiv(fgnd_sp, 0.044704)
The float functions are available from the functions button in the calculation icon.
There is lots of information on the forums regarding these functions.
wayne millard
Posts: 234 Joined: Thu May 31, 2007 2:18 pm
Has thanked: 7 times
Been thanked: 12 times
Post
by wayne millard » Thu Mar 25, 2010 3:38 pm
Hi Benj,
Thanks for the help can you show me a example of how to do this because im lost.
Thanks,
Wayne
Benj
Matrix Staff
Posts: 15312 Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:
Post
by Benj » Fri Mar 26, 2010 10:51 am
Hi Wayne,
This program should now compile and run correctly on the hardware.
Let me know how you get on.
Attachments
GPS Time and Date position.fcf
(16.52 KiB) Downloaded 333 times
Benj
Matrix Staff
Posts: 15312 Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:
Post
by Benj » Fri Mar 26, 2010 1:53 pm
Hello Wayne,
The error is related to this line of C code near the start of your program.
float_detect_tininess = long;
This should instead look like this.
float_detect_tininess = 1; //Detect tininess before divide
or
float_detect_tininess = 0; //Detect tininess after divide