MobiFlight Community Support

Welcome to the forum for MobiFlight! Feel free to reach out to the community in case you have questions, issues or just want to share great ideas or details about your latest home cockpit project.

You like MobiFlight? Donate via PayPal and support the MobiFlight development. Thanks! 

05/03/2024 - This forum is read-only

The community support for MobiFlight has moved exclusively over to our Discord server. Register for free and enjoy more interactive functions like image and video upload, voice chat. More than 7,000 registered users around the world make it a great experience!

See you on our MobiFlight Community Discord server.

A HUGE Thank You to everyone who participated in the forum, especially obviously to Pizman and Stephan who did an outstanding job over so many years providing an incredible service to the MobiFlight community.

The forum is still providing a lot of good content, hence we keep this information accessible.

Posts: 6
I am connecting the mega 2560 R3 module to a ledmodule to display the vertical speed value of the autopilot;
the variable returns the value in feet and must be transformed into feet per minute.
the variable fs2020 used is: (A: AUTOPILOT VERTICAL HOLD VAR, ft)
in more options, transform I wrote: $*60
there is the problem of the rounding, for example when the autopilot in the sim displays 200 the led module displays 199.
I have verified that the Round() function does not work while the Ceiling(), Floor() and Truncate() work well.
can anyone suggest a solution?
thank you

ps: mobiflight connector 9.2.0
2022-03-06 13:39
From: ETSI, Germany
Posts: 6010

I not know how this Variable looks like.... But from the description text this is already Feet per Minute.
Maybe the info is missleading.... So check yourself if the $*60 is really needed.

About Rounding.

Rounding only work for a Float Value .
Syntax is Round(Value,Decimal Numbers)
So for example Round(1.234,1) = 1.2

Your Problem: 199 Can not be Rounded, in case its no Decimal Number.

Solution :
In your example 199/10=19,9 Rounded to Zero Decimals = 20 and finally *10 = 200

LAST NOTE: Take Care that Round must be written with a capital R !!
Good Luck !
2022-03-06 16:42
Posts: 6
thanks for the help,
my error was in Round() syntax:
Round ($ * 60,0) is correct,
Round ($ * 60) doesn't work
the VS variable of the simulator:
is in feets
flight sim value: 8.33333301544189
output value: 500
therefore transformation is needed with

2022-03-06 20:56