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.

icon
Avatar
les
Posts: 21
Hi everyone,

I'm just starting out with using the mobiflight connector and arduino- so usefull!!!
I have a couple of max7219 displays which are working, but with a few teething problems!

Using the presets in mobiflight, current altitude works perfectly,. Current heading gives a rather odd. Display- my heading of 289 read as -107.

Lastly I'm trying to display Mach number using the listed fsuipc offset of 11C6 , so in the offset box, I entered '0x11C6' . But I don't know what to enter in the other option boxes. . Iget numbers displayed but not the right format.

Fsuipc gives the offset use as *20480

Can anyone give me a point in the right direction for using manually entered offsets?
I have read the documentation but can't quite get there!!

Thanks in advance

Les
2017-05-08 14:15
Avatar
les
Posts: 21
Hi, some further progress:

I have set offset to '0x11C6" (Mach speed from fsuipc guide) value type "int" , size in bytes to "2"
Mask value I don't understand yet, it is set to "0xffff"

Transform ticked and set to $/20486. (fsuipc guide states "*20486" in the "use" section, but fsuipc output value when the aircraft is at mach1 is about 20486 so it would appear to be division required?

In the display tab, I have display 6,7 and 8 ticked,
Decimal point at 6.

It now reads "0.00" below mach1 and "0.01" above Mach 1. Would this be mask I need to change to display numbers less than 1?

Apologies for the basic questions...

Les
2017-05-08 15:53
Avatar
les
Posts: 21
I'm guessing the "integer" value is of course the issue, but any other value entered doesn't seem to work at all!!
2017-05-08 16:36
Avatar
DocMoebiuz
Moderator
From: EDSH, Germany
Posts: 1516
Try with multiplying by 100.
MobiFlight rounds the number to the closest integer before sending to your output, e.g. display.

If the Mach was 0.80 it would round to 1.

If you additionally multiply by 100 the value would be 80. with left padding activated and using zeros for padding and the decimal point on the first digit it will display the correct value.
Have a great day!
Sebastian

MobiFlight - Simply build your own home cockpit for your favorite flight sim - MSFS2020, FSX, Prepar3D (FSUIPC), X-Plane (XPUIPC)
2017-05-08 16:44
Avatar
les
Posts: 21
Hi,

Thanks for the reply, that seems to have worked,
I think I have introduced an error- at exactly Mach 1 it reads correctly , then above and below that, it reads progressively bigger error the further away from Mach 1 you get..

It will do for now!!!
Thanks very much!
2017-05-08 17:50
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Hi Les .....Welcome to Mobiflight.
I Think you need a little more detailed information to get succes in youre first steps !

First... The Presets :
Please Note... This presets is a verry old part of the Mobiflight Programm.... At Beginning Sebastian think about to give us Presets for all things we need.... But this is a high workflow to write this Presets.... So nobody find time to do this in the past. Also the presets are still there vor some less functions. Additional while time goes by mobiflight get some new features and some old stuff is gone.... So Maby some of the Presets not work 100% correct with the current Version and need some manual modifications by the user !

Recommend Technic at the moment... You can try the Presets ( or use them like examples to learn how it works) BUT simply build youre own configs self and set them like you want or need it.

**********
I see you already found the FSUIPC offset List.... thats the way to make a own config.
Additional i see you see and understand that there are sometimes NOTES in this list when we need to comapare a Offset in special way!

So STEP 1:
Some Offsets ( Like the Altitude Preset Offset 3324 is working fine.... It already give us a clear value as we need it... If Altitude is 15000 ft then Output of Offset is 15000 too.
Other Offsets just give as a raw Value and we need to compare it.... so it looks like we need it.

For Exmaple the "Mach Speed" 11C6 2 Byte INT ...... Here we got the Note "Mach speed * 20480"
This means... The Raw Offset we read out is a Number that is the current Mach Speed Multiplied with 20480 !
For Example... If Mach Speed is exact "1,00" then the Value of the FSUIPC Offset is 20480 at the moment... ( 1,00 * 20480 )
So you already understand.... If we like to show the mach speed itself we need to Divide the Raw Value thorugh 20480 !

Another Example thats more Complex is the Heading Offset 0580 4 Byte INT There the Note is "Heading, *360/(65536*65536) for degrees TRUE"
So here we not net to calcualtion backwards.... here we need to do what they say to get True Heading in Degrees.
Always read the exact description... It told us how we need to campare it.

I See, too you already know the Transform field and you still can do this modify of the Values !

****
STEP 2

Most Values now are OK and work for us..... BUT Some situations are a little difficult cause Mobiflight, FSUIPC or maby the MAX7219 Tubes need a litttle different Values to can work.
YOU got lucky and find instaly 2 Offsets that are Problematic :thumbup: the HEADING and the MACH Offset are those kind and need a little more modification from ourself.

-The Heading Offset:
After you do the Compare from Above the True Heading Offset got a little issue..... It´s a signed/unsigned Problem from Mobiflight and FSUIPC..... That occurs in youre descripted problem.... A Heading from 0-179 is Positiv.... A Heading of 180 is shown as -180 .... A Heading of 181 is shown as -179 and so on. So 180-359 is negative !

TO SOLVE THIS.... We need here a additional Compare and must add 360 to the value if it´s negative.
Open the Compare Tab in Mobiflight Config Wizzard and set the Checkmark ! Then use the Dropdown nearby " If value is" and select the "less then Symbol" < Set in the field zero... 0.
in the THEN field please insert $+360 .
This means.... Everytime the Value is less then Zero, Add $+360 ( $Dollar sign is internal variable for Current Value)
THEN it workes.... If for example Value is 270° and it would show -90 then -90+360=270 .... Result is Perfect!

-The Mach Offset. ( Like Sebastian already explaned)
Here we do the Compare/transform like you told..... the Result is a decimal Value... If we got Mach .78 the Value is 0,78
Here the Problem is Mobiflight and the Max7219 Chip NOT acept Decimal Values... 0,78 looks for the MAX Chip like 0
TO SOLVE THIS... Multiply the Value with 100 .... So from example Mach.78 is not longer 0,78 Then it´s 78
You can use the transformfield too..... For FSUIPC Compare you already use: $/20480 Now use : $/20480*100

Keep Cool.... Lots of Offsets work fine without any additional work.... Youre still lucky to find two difficult examples in youre first try.

***************
@ SEBASTIAN

iconDocMoebiuz:


MobiFlight rounds the number to the closest integer before sending to your output, e.g. display.
If the Mach was 0.80 it would round to 1.



I can NOT confirm this..... Looks like Mobiflight still round to the lower integer ( not the nearest) Whatever Mach 0,4 ,0,6 0,99 ALL is 0 ...
If Value is over 1 then all is 1 Whatever 1,01 or 1,55 .
No Problem... Just for Info !
Good Luck !
2017-05-09 01:09
Avatar
les
Posts: 21
Hi Sebastian,

Thanks very much that's a great explanation- I was almost there but couldent quite figure it all out!!!

I sure Ill have loads more questions as I progress with the build!!

thanks again

Les
2017-05-11 22:33
Avatar
DocMoebiuz
Moderator
From: EDSH, Germany
Posts: 1516
Btw, pizman is right, it will use the floor function to actually cut off the values after the decimal point. Otherwise we could not shift the numbers from left to right (by division with 10) and vice versa (by multiplication with 10)
Have a great day!
Sebastian

MobiFlight - Simply build your own home cockpit for your favorite flight sim - MSFS2020, FSX, Prepar3D (FSUIPC), X-Plane (XPUIPC)
2017-05-13 05:58
icon