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! 

icon
Avatar
herbiem
Posts: 38
Is it possible to use one rotary encoder for 2 function by using a switch to change the function
Am building my C172 radio panel for FSX and am up to the AP ( all the rest working fine) and would like to use a switch to change between ALT and VS and the encoder to change the values of either VS or ALT
Thanks
Ian
2018-09-03 07:01
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 2950
Supporter
Hi Ian.

Yes this is possible..... Whatever in a bit advanced way.
We have a guide that include that https://www.mobiflight.com/forum/topic/652.html . EDIT: I See the Pictures are broke there. So it is not verry usefull.

NOTE: The technic will work BUT Please think about if your system is usefull. Do this with the Khz/Mhz swap of Radios all is ok.... Thats done in Real aircrafts, too.
But savety relevant Things like VS-ALT are never combine in ONE Display or via ONE Encoder.... If you will for example reduce ALT to 3000 but you make a misstake and set VS to -3000 (without realise that youreself) then you will crash and kill your pasengers !
So.... Those functions will be never combined in real world !

*****

Basic Idea.
You need a Single Config for every function in Mobiflight.
If you like to controll ALT and VS BOTH need a single config ( One use the Event/Offset of ALT ... the other use the Event/Offset of VS )
NOW you tricky use for BOTH Configs the same Encoder as device !

Problem: Now the encoder will controll both functions same time ! So we need a precondition each to tell the encoder what function he should controll at the moment.

Technic:
Mostly you use the Button on encoder for that.
Create a Input Device ... BUTTON for that with this Button of encoder.
Create a Input Config and use OFFSET 1 Byte Adress 66C0 (66C0 and the follow are free offsets ... get shure you not use it for other things)
In Value field you say : if($=1,0,1) ..... This will toggle the value on every use of your button... if 1 then 0 If 0 then 1 .

Finaly create a Output Config that readout the Offset you write in last step ( 66C0 1 Byte INT in our example) and call it for example "Toggleswitch"

Now use in the 2 Encoder Configs a Precondition.... For exmaple the ALT should only work if Outputconfig "Toggleswitch" is "0" ..... And the VS Config should only work if the same "Toggleswitch" config is "1" .

NOTE: This can be done more detailed, too. For example with a 12 Position switch that write the offset to 12 different States... So you can controll 12 things with one encoder.
Or you can make a Push button that switch through 5 different things ( First push control ALT next VS next HDG next SPD and so on)
I just explane the main logic.... With ather "Value logic" you can do lots of nice things here!
*****


I hope you understand this short guide..... If not just tell us where you get in trouble... we try to help !
Good Luck !
2018-09-03 16:22
Avatar
herbiem
Posts: 38
Thank you for your prompt reply
Yes I can see that it could be a problem having both on the same encoder ( don't want to kill anyone);)
Perhaps I need to take a different approach and use a double encoder
Ian
2018-09-04 01:14
Avatar
rodo2212
Posts: 9
iconpizman82:

Hi Ian.

Yes this is possible..... Whatever in a bit advanced way.
We have a guide that include that https://www.mobiflight.com/forum/topic/652.html . EDIT: I See the Pictures are broke there. So it is not verry usefull.

NOTE: The technic will work BUT Please think about if your system is usefull. Do this with the Khz/Mhz swap of Radios all is ok.... Thats done in Real aircrafts, too.
But savety relevant Things like VS-ALT are never combine in ONE Display or via ONE Encoder.... If you will for example reduce ALT to 3000 but you make a misstake and set VS to -3000 (without realise that youreself) then you will crash and kill your pasengers !
So.... Those functions will be never combined in real world !

*****

Basic Idea.
You need a Single Config for every function in Mobiflight.
If you like to controll ALT and VS BOTH need a single config ( One use the Event/Offset of ALT ... the other use the Event/Offset of VS )
NOW you tricky use for BOTH Configs the same Encoder as device !

Problem: Now the encoder will controll both functions same time ! So we need a precondition each to tell the encoder what function he should controll at the moment.

Technic:
Mostly you use the Button on encoder for that.
Create a Input Device ... BUTTON for that with this Button of encoder.
Create a Input Config and use OFFSET 1 Byte Adress 66C0 (66C0 and the follow are free offsets ... get shure you not use it for other things)
In Value field you say : if($=1,0,1) ..... This will toggle the value on every use of your button... if 1 then 0 If 0 then 1 .

Finaly create a Output Config that readout the Offset you write in last step ( 66C0 1 Byte INT in our example) and call it for example "Toggleswitch"

Now use in the 2 Encoder Configs a Precondition.... For exmaple the ALT should only work if Outputconfig "Toggleswitch" is "0" ..... And the VS Config should only work if the same "Toggleswitch" config is "1" .

NOTE: This can be done more detailed, too. For example with a 12 Position switch that write the offset to 12 different States... So you can controll 12 things with one encoder.
Or you can make a Push button that switch through 5 different things ( First push control ALT next VS next HDG next SPD and so on)
I just explane the main logic.... With ather "Value logic" you can do lots of nice things here!
*****


I hope you understand this short guide..... If not just tell us where you get in trouble... we try to help !



Hello.I have been thinking about this.
I have and lcd display 16x2 and one rotary enconder. By your help and seeing other topic, with one rotary i could change MHZ and HZ of the RADIO or NAV using its push button, And then with other button pass from standby to active.
For far so good. This just happen in one line off my lcd. How could I do the same thing for the second line from my lcd? B)
Regards and Happy new year.
Luis
2019-12-31 15:01
Avatar
DocMoebiuz
Moderator
From: NW of KPWK, United States
Posts: 1441
As pizman wrote and explained, It’s totally possible to have a switch write it’s position to an offset and then use the value of the offset as precondition to display values depending on its position.

It also works for the Inputs of course.

I did make a radio with one Encoder where when I pushed the Encoder and triggered the built in switch I was switching between manipulating MHz vs KHz respectively.

So please take a look at Preconditions and the possibilities that they give you.

I don’t see an issue with controlling many different values with one instrument. Look at the Saitek Multi Panel - they basically do the same thing there. You can build a panel with identical functionality easily with MobiFlight.
Have a great day!
Sebastian

MobiFlight - Simply build your own home cockpit for your favorite flight sim - FSX, Prepar3D (FSUIPC), X-Plane (XPUIPC)
2019-12-31 17:56
icon