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
Japmaco
Posts: 48
I have ripped down a Saitek Radio Panel and borrowed the rotary swithes as u can see on the pictures down below.

I have played around with Pokeys 57E which is Perfect for my leobodnar encoders, Perfect sync with every detent. Then i have my mega 2560 for displays and the rotary switch was the plan. If they fix the issues on Mobiflight with detents with this encoder then till happy throw out my Pokeys card. I love the arduino board. Im just a fan of the lan port and the possibilities u get.

Some questions...

- like the Saitek Radio Works with the rotary switches.. when u turn to com1 it displays the com 1 on the displays and also activate the dual encoder to com 1...
Is this possible on the Mobiflight? Or what do i have to do. I suck in programming so i need help.

-Do Mobiflight have arduino lcd support or coming in a near future. Would be Nice to use to display some useful data...

Thanks for a great software!


https://drive.google.com/file/d/0B4l10Z7TehC9bEs1ZlVfRnQ3aUk/view?usp=drivesdk

https://drive.google.com/file/d/0B4l10Z7TehC9dzdfa3gtam43UDg/view?usp=drivesdk
2016-07-16 16:17
Avatar
DocMoebiuz
Moderator
From: EDSH, Germany
Posts: 1516
Yes, you can do that with preconditions.

You configure your rotary switch via several input config items (one for each rotary position)
You have to set values at a custom FSUIPC offset (e.g. 0x66C0) via the rotary switch. E.g. Pos HDG set 1, Pos ALT set 2, Pos V/S set 3.

Then you configure one config item, that reads this offset so that it can be used for preconditions.
Then you configure several config items for the different information (e.g. HDG, ALT, V/S) that you want to display. Each config item then will have a precondition where you use the custom offset and compare with the corresponding value (0x66C0 = 1 then HDG is active, 0x66C0 = 2 then is active, etc).

I hope that explains it.
Have a great day!
Sebastian

MobiFlight - Simply build your own home cockpit for your favorite flight sim - MSFS2020, FSX, Prepar3D (FSUIPC), X-Plane (XPUIPC)
2016-08-22 05:40
Avatar
fazli
Posts: 91
iconDocMoebiuz:

Yes, you can do that with preconditions.

You configure your rotary switch via several input config items (one for each rotary position)
You have to set values at a custom FSUIPC offset (e.g. 0x66C0) via the rotary switch. E.g. Pos HDG set 1, Pos ALT set 2, Pos V/S set 3.

Then you configure one config item, that reads this offset so that it can be used for preconditions.
Then you configure several config items for the different information (e.g. HDG, ALT, V/S) that you want to display. Each config item then will have a precondition where you use the custom offset and compare with the corresponding value (0x66C0 = 1 then HDG is active, 0x66C0 = 2 then is active, etc).

I hope that explains it.

2018-03-20 19:38
Avatar
fazli
Posts: 91
hi sir,
i have question about pre condition.
i have created precondition free offset 66C0 at rotary endcorde (baro hpa in)
the question is ' can i use another one encoreder rotary (baro minimum radio) same offset 66C0 as precondition. any suggestions free offset .tq
# on the way build EFis panel
2018-03-20 19:45
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Hi.
You mix up a bit....

That technic is need to show different informations to ONE Display.... In case of a switch Position.
In a EFIS the BARO and MINS Rotarys are not need to show on a Display... So a Custom Offset is normaly not usefull here

But maby i understand wrong whats youre intentions.... If needed please explane me exactly WHAT you like to do..... Then i can think about !

.
Good Luck !
2018-03-21 14:53
Avatar
slammer88
From: LTBJ, Turkey
Posts: 160
iconDocMoebiuz:

Yes, you can do that with preconditions.

You configure your rotary switch via several input config items (one for each rotary position)
You have to set values at a custom FSUIPC offset (e.g. 0x66C0) via the rotary switch. E.g. Pos HDG set 1, Pos ALT set 2, Pos V/S set 3.

Then you configure one config item, that reads this offset so that it can be used for preconditions.
Then you configure several config items for the different information (e.g. HDG, ALT, V/S) that you want to display. Each config item then will have a precondition where you use the custom offset and compare with the corresponding value (0x66C0 = 1 then HDG is active, 0x66C0 = 2 then is active, etc).

I hope that explains it.



Hi Doc,

I think this is the answer what i'm looking for my current radio panel project. I'll implement 5 different buttons for 5 different modes (NAV1-2, COM1-2, ADF) and use a common 7 digit to show their values as active & standby. Can you explain this system in a bit detail ?

What i understand is, that i should first connect 5 buttons to any digital inputs along with the led output. Then i config them in Mobiflight and give them custom offsets. Then i shall introduce conditionals to each of the buttons to show the related values in the LED. Is that correct ? Also, if i want to use momentary buttons with LED's, can i also use them by connecting 5 more inputs and config them as output for each custom offsets mentioned above ? When they have the value "1", which means pressed once, do they remain lit until pressed any other ?
2018-12-04 07:52
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Hi Slammer.

Note: I delete the other topic cause you request the same information, there !

Basic Information:

We talk here about a rotary switch. this is a rotary "Multi-position" switch. NOT a Encoder !!
For example this .... https://www.ebay.co.uk/p/2x-1-Pole-12-Way-0-3a-250vac-Black-Rotary-Switch-Solder-Terminals-18-Teeth-Shaft/1494233585?iid=201971037280

Basicly those switches are same like Push Buttons ! ... For example a 5 Postition Rotary switch is simmular to 5 individeual Push Buttons.
If you set Rotary switch in Position A then its same like Pushbutton A is pressed. If you turn the switch to position B then its the same like Pushbutton A is released and shortly behind Pushbutton B is press.

So for this system its no matter if you use a 5 Position Rotary switch OR like in your request 5 individual Buttons.
In both situations you must create 5 Input Devices ( Typ Button) on 5 Pins. No Matter if you wire the 5 Poles of the rotaryswitch or the 5 push buttons.

******
About the logic.

Here you missunderstand... The INPUT Config of your Buttons will NOT controll the needed Function ( Like a 7 Segment Display and choose between Com1 and Com2 )
Your Input Config still controll a CUSTOM Offset.... And finaly your Function (you like to controll) will only work in case if this offset is TRUE.

For Exampe:

You Have 1 Display and you have 2 Buttons. You like to show COM1 if button 1 is pressed and COM2 if button 2 is pressed.
Here you need 5 Configs.
1. INPUT Button 1 : On PRess write CustomOffset ( For eampkle 66C0) to 0
2. INPUT Button 2: On Press write SAME Offset (66C0) to 1
3. OUTPUT (No Device.... Just for Preconditioning) READ Offset 66C0 Name for Example "STATUS COM"
4. OUTPUT Com 1 Display.... Device is Your 7 Segment Display... Offset: The Com1 Offset PRECONDITION: Only work if "StatusCOM" = 0
5 OUTPUT Com 2 Display.... Divice is the SAME Display like in Config 4 .... Offset: The Com2 Offset PRECONDITION: Only work if "StatusCom"= 1

You see..... If you Press Button 1 then Offfset is set to "0" .... If you Press button 2 then Offset is set to "1"
If Offset is 0 then the Output Line of COM1 is active and show COM1
If Offset is 1 then the Output Line of COM2 is active and show COM2

*******

Finaly you have lots of possible workarounds here.

For example those Preconditions can be used also with INPUT configs. You can create in the upper example a Input Encoder to change the Frequencys.
If Custom Offset is set to "0" for COM1 then your encoder will controll Com1. In a second Input Config for Same Encoder you say if Costum Offset is "1" then now it should controll COM2.

You also can make for example a "Toggle" With only ONE Input Button you can say .... if($=1,0,1) .... Now a Button Push will toggle between 0 and 1.. So you can toggle between 2 different things with only one button.
another way is to toggle between multiple things. For example ONE Button with if($=4,0,$+1) ... With this your button will controll the offset for 0,1,2,3,4,0,1,2,3,4 and so on.

**************
Sorry for this overdose of information. I Hope you understand. If not please give me a example what you like to build exactly. then i can explane you specific what you need to do.
Good Luck !
2018-12-04 23:47
Avatar
slammer88
From: LTBJ, Turkey
Posts: 160
Hi pizman,

Thanks for your detailed information.

That's the setup i'd like to make actually and it seems it's gonna work. Only difference is that there's this StatusCom you mentioned, functioning as a bridge between the commands which trigger COM1 and 2.

My setup is like as below;

1 Common 7219,
5 Momentary Buttons with LED (5 more inputs for LED outputs)

What i want to happen is ;

When i press Button 1 once (say COM 1), i'll see COM 1 Act/Std frequencies in the LED, and also the LED will be lit as long as COM 1 is active.
When i press Button 2, (say COM 2), i'll see COM 2 Act/Std frequencies in the LED, and also the LED of COM 1 will go off and LED of COM 2 will be lit.

The only thing in my mind is, will i be able to use a common encoder & switch button to change values. How should i config these ?
[Last edited by pizman82, 2018-12-05 12:54]
2018-12-05 06:20
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Thats Simple. ( Whatever the Text is long and detailed.... Sorry for that)

At first you need ONE Custom Offset for the whole system... Lets Say we use 66C0 1 Byte INT. ( Normaly thats a free offset.... Some AddOns use it then you need another one like 66C1 66C2 and so on. If System get in trouble you should check if the Offset is free.


Then lets build your Toggle Logic.

You say you use 5 functions ( Com1 Com2 Nav1 Nav2 and ADF )
So you need 5 Momentary Buttons ! Please get sure your LED in the Buttons are indipendent ! If you got Buttons where LED is light always aslong button is pushed ( electrical hardcoded setup) this will not work. You need Buttons where the LED is a own circuit.... so it can be powered ON/OFF indipendent of the Switch position. Normaly those buttons got 4 Pins .... IN-OUT-LEDPowr-GRD .

Create in MF 5 Input Devices Typ Button ( For example Pin 5,6,7,8,9 ) and call it for example "Button 1" "Button 2" and so on.
Wire each button to this Pins ( Not use LED at the moment)

Now open a New Mobiflight Config File.
1. Create "READOUT" Config we use later for Preconditioning. So create a OUTPUT Config ( No Device) and read the used Offset ( For example 66C0 1 Byte INT)
Call it for example "Status Radio"
2. Create 5x Input Config.
First Config use Button 1 as device and will write typ "FSUIPC Offset" . Use 66C0 1 Byte INT and Parameter is "0"
Next will use Button 2 as Device and will write again the SAME Offset 66C0 but now parameter is "1"
Do the same for Button 3,4,5 and use Parameters 2,3,4 there
( I start here with parameter "0" cause on Systemstart a Customoffset is always "0" ... So COM1 is always active when you start your Homecockpit. You can work here also with parameter 1,2,3,4,5 .... But then on Systemstart NO FUNCTION is selected and your Displays are Blank ! )

****
On That Point the system still work !

If you Press a Button then the CUSTOM Offset is written to a Value.... And our Readout Config show this Value. So we have a "Indicator" for the whole system already working !
All follow is simply like a Self running system.... We just use this indicator now for preconditioning or as direct value (for example in the LED System)



*******

Lets talk about the LEDs in your Buttons.
Here you first need every LED like a own device.... So create 5x LED Device ( for example Pin 10,11,12,13,14) and wire Your LEDs.
Create in Mobiflight Five Output Configs. ...
Config 1 Use LED 1 .... Config 2 Use LED2 and so on.
ALL 5 Configs use as Offset the SAME Cutom Offset we talk above ( For example 66C0 )

Now we must compare the value ( You can do this via compare tab of Mobiflight OR via a IF-ELSE in the Transform field... (I simply explane the Compare technic)

Com1 LED (First button) should light always if Com1 is active... So when our Button write the Custom offset to "0" .
So we say in Compare Tab.... IF Value = "0" THEN "1" ELSE "0" ....
That Means... If Value is Zero (Com1 is active) Then set Value to "1" (LED Light)... If Value is NOT 0 ( For example when Com2 is Active at the moment) then set Value to "0" and disable the LED.

Com2 LED (Second Button) should light always if Com2 is active. So when our Button write Custom Offset to "1"
Here you say in Compare Tab ... IF Value = "1" THEN "1" ELSE "0" .... Now LED light only aslong Custom Offset = 1 All other cases its "0" and its off.

Same for the Others ... NAV1 Say IF Value = 2 THEN 1 ELSE 0 ...... NAV2 Say IF Value = 3 THEN 1 ELSE 0 and ADF Say IF Value = 4 THEN 1 ELSE 0

NOW all the LEDs are working correct, too.

***********************
Finaly you need to build the Inputs and Outputs you need. Here its simple.
Create a Set of Configs like you will only build one System ( Like COM1)
So create the Output Configs for your Display ( or two if you build also a Standby Display)
Create all the Inputs for your Swap Button or your Encoders.
Use for all the Configs the needed Offsets and Events to controll COM1 stuff.
If all is working THEN simply add in ALL Configs here a Precondition and say " Only work if "Status Radio" Config = 0

Now the whole set of Configs you create for COM1 is only work aslong your Custom Offset is "0" ( Means Com 1 Button is selected)

And now you will create all this configs you did for Com1 once again. ( Or you copy/duplicate them) .
The second set of Configs now use SAME Devices like Displays and Buttons/Encoders BUT controll Offsets/Events of COM2
And now you must rework all Preconditions so that they work only if "Status Radio" Config = 1 ( Means Com2 is current mode)

Finaly you did it again for Nav1 Nav2 and ADF.... Create again all configs.... But just use in precondition now value 2,3,4

**********
In Easy words....
You create for each Function ( Like the Display that show Active Frequency) basicly 5 single Configs.... Each Config read its own value (like Com1, Com2 and so on)
With the Precondition we get sure that always there is only ONE of the Configs is active ! ... And we use the Custom Offset as "Indicator" to define this !
Good Luck !
2018-12-05 12:53
Avatar
slammer88
From: LTBJ, Turkey
Posts: 160
iconpizman82:

Thats Simple. ( Whatever the Text is long and detailed.... Sorry for that)

At first you need ONE Custom Offset for the whole system... Lets Say we use 66C0 1 Byte INT. ( Normaly thats a free offset.... Some AddOns use it then you need another one like 66C1 66C2 and so on. If System get in trouble you should check if the Offset is free.


Then lets build your Toggle Logic.

You say you use 5 functions ( Com1 Com2 Nav1 Nav2 and ADF )
So you need 5 Momentary Buttons ! Please get sure your LED in the Buttons are indipendent ! If you got Buttons where LED is light always aslong button is pushed ( electrical hardcoded setup) this will not work. You need Buttons where the LED is a own circuit.... so it can be powered ON/OFF indipendent of the Switch position. Normaly those buttons got 4 Pins .... IN-OUT-LEDPowr-GRD .

Create in MF 5 Input Devices Typ Button ( For example Pin 5,6,7,8,9 ) and call it for example "Button 1" "Button 2" and so on.
Wire each button to this Pins ( Not use LED at the moment)

Now open a New Mobiflight Config File.
1. Create "READOUT" Config we use later for Preconditioning. So create a OUTPUT Config ( No Device) and read the used Offset ( For example 66C0 1 Byte INT)
Call it for example "Status Radio"
2. Create 5x Input Config.
First Config use Button 1 as device and will write typ "FSUIPC Offset" . Use 66C0 1 Byte INT and Parameter is "0"
Next will use Button 2 as Device and will write again the SAME Offset 66C0 but now parameter is "1"
Do the same for Button 3,4,5 and use Parameters 2,3,4 there
( I start here with parameter "0" cause on Systemstart a Customoffset is always "0" ... So COM1 is always active when you start your Homecockpit. You can work here also with parameter 1,2,3,4,5 .... But then on Systemstart NO FUNCTION is selected and your Displays are Blank ! )

****
On That Point the system still work !

If you Press a Button then the CUSTOM Offset is written to a Value.... And our Readout Config show this Value. So we have a "Indicator" for the whole system already working !
All follow is simply like a Self running system.... We just use this indicator now for preconditioning or as direct value (for example in the LED System)



*******

Lets talk about the LEDs in your Buttons.
Here you first need every LED like a own device.... So create 5x LED Device ( for example Pin 10,11,12,13,14) and wire Your LEDs.
Create in Mobiflight Five Output Configs. ...
Config 1 Use LED 1 .... Config 2 Use LED2 and so on.
ALL 5 Configs use as Offset the SAME Cutom Offset we talk above ( For example 66C0 )

Now we must compare the value ( You can do this via compare tab of Mobiflight OR via a IF-ELSE in the Transform field... (I simply explane the Compare technic)

Com1 LED (First button) should light always if Com1 is active... So when our Button write the Custom offset to "0" .
So we say in Compare Tab.... IF Value = "0" THEN "1" ELSE "0" ....
That Means... If Value is Zero (Com1 is active) Then set Value to "1" (LED Light)... If Value is NOT 0 ( For example when Com2 is Active at the moment) then set Value to "0" and disable the LED.

Com2 LED (Second Button) should light always if Com2 is active. So when our Button write Custom Offset to "1"
Here you say in Compare Tab ... IF Value = "1" THEN "1" ELSE "0" .... Now LED light only aslong Custom Offset = 1 All other cases its "0" and its off.

Same for the Others ... NAV1 Say IF Value = 2 THEN 1 ELSE 0 ...... NAV2 Say IF Value = 3 THEN 1 ELSE 0 and ADF Say IF Value = 4 THEN 1 ELSE 0

NOW all the LEDs are working correct, too.

***********************
Finaly you need to build the Inputs and Outputs you need. Here its simple.
Create a Set of Configs like you will only build one System ( Like COM1)
So create the Output Configs for your Display ( or two if you build also a Standby Display)
Create all the Inputs for your Swap Button or your Encoders.
Use for all the Configs the needed Offsets and Events to controll COM1 stuff.
If all is working THEN simply add in ALL Configs here a Precondition and say " Only work if "Status Radio" Config = 0

Now the whole set of Configs you create for COM1 is only work aslong your Custom Offset is "0" ( Means Com 1 Button is selected)

And now you will create all this configs you did for Com1 once again. ( Or you copy/duplicate them) .
The second set of Configs now use SAME Devices like Displays and Buttons/Encoders BUT controll Offsets/Events of COM2
And now you must rework all Preconditions so that they work only if "Status Radio" Config = 1 ( Means Com2 is current mode)

Finaly you did it again for Nav1 Nav2 and ADF.... Create again all configs.... But just use in precondition now value 2,3,4

**********
In Easy words....
You create for each Function ( Like the Display that show Active Frequency) basicly 5 single Configs.... Each Config read its own value (like Com1, Com2 and so on)
With the Precondition we get sure that always there is only ONE of the Configs is active ! ... And we use the Custom Offset as "Indicator" to define this !



You're great, that's the best explanation ever! Thank you!
2018-12-06 06:22
icon