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
10_4csb
Posts: 2
I am new to Mobiflight and I haven't been able to find a answer to my problem on google.

I am making a mini G1000 panel for msfs2020. At the moment I only have one rotary encoder that I would like to use for HDG, ALT and FMS.
I would like to have one push button that toggles between 3 led's (showing alt, hdg, fms) and then use the 'Precondition function' to read what
function should be active for the encoder.

Is this possible?



/Carsten :-)
2021-01-07 22:48
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
In case the header ask "direct from Arduino" the awnser is NO. But there exist a workflow.

There is no way (a.t.m.) to set a LED directly in case of Real Switch Position ( Or a toggle logic)
A LED is a OUTPUT.... and a Output always is related to the Value of a FSUIPC Offset !
So if you like to Light a LED.... Or if you like to define what function a encoder should controll at the moment ( by Precondition) this is ALWAYS related to a exsiting Offset.

Now the question is.... Does this Offset already exist ?
If your AddOn Aircraft for example also got these 3 LED´s maybe there exist a Offset that tell us what virtual LED is currently ON.
Same for Encoders.... You need no Preconditions if there exist also a virtual Button that toggle these Modes.... Then you can simply controll THAT virtual button by a event.

Mostly these Systems not exist.... So we must build them ourself.... And here the Key is a "Custom Offset".
We use a free Offset ( e.g. 66C0 Area) and write it with our "selector". In your case you will make a INPUT Config that write Offset 66C0 with a momentary Button.
I not see your planing if this is one button that should toggle or if we talk about 3 Buttons ( below LEDs e.g.) . Important is.... We set the Custom Offset to 0, 1 or 2 with our button(s).

2nd Step is to build a Output Config (without a device in use) that simply read this custom Offset Again.
And NOW we got a Offset that include the needed information.... A Number between 0 -2 we can use.

At last we build the LED Configs and the Encoder Configs.
For example the first LED should light if Custom Offset = 0 .... the Second should light if Custom Offset =1 and so on.
The first Encoder Config is using the Event/Offset for HDG .... And it get Precondition "Only work if Custom Offset = 0"
The Second Encoder Config use the SAME Encoder.... But now the Events for ALT .... And Now Precondition is "Only work if Custom Offset = 1"

I hope you understand !
Good Luck !
2021-01-08 18:16
Avatar
10_4csb
Posts: 2
Thank you så much, it helped a lot. :)

I am usually quite good at electronics and programming, but this needs a different mindset. Anyway, I now have one push button
that I can use to switch between 3 led's and 3 different functions for one rotary encoder.

Thanks again. :thumbup:

/Carsten
2021-01-09 14:48
icon