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
LastPilot61
Posts: 6
HI,
I'm using 2 x 4-position switches to control engine ignition,
during the ignition phase I put my switch in the GRD position and the corresponding one on the OH panel also moves to GRD,
when N2 is correct the virtual on OH moves to off while my switch stays on GRD.
At this point I have installed a LED and I want to turn it on when this condition occurs so that it reminds me to move my switch to off.
to do this I created a second input connected to the same analog input of my switch and I associated a mobiflight variable "eng1knob_pos" of type "number" in the value field I inserted "
iconCode:
$=Round(@/34.1,0)
" to have the corresponding values 0 - 10 - 20 - 30 for GRD - OFF - CONT - FLT.
I then created an output "eng 1 knob led var" associated with the mobiflight variable created before without inserting anything in the transform field.
I then created an output connected to the LED where I could compare the virtual knob with the variable, using "add reference", so that if the first is 10 while the second is 0 I turn on my LED.
unfortunately it doesn't work because the eng 1 knob led var output does not read the input variable "eng1knob_pos".
How can I solve the assignment of a variable to the value of an analog input?
Thanks for your help
[Last edited by LastPilot61, 2023-10-03 00:51]
2023-10-03 00:45
Avatar
XPRoberto
From: Hungary
Posts: 65
Hi,
If I understand well you want to lit a LED when
A eng1knob_pos = 10 AND
B switch_pos_in SIM = 0 - This has to be created to be 0 for OFF and 1 for any other state.

For the LED output page I would do 2 references (A and B ) and say:
if(A=10,1-B,0)
Therefore the LED will ON when your knob = 10, but the knob in sim = 0.
----------------------------------------------------------------
Do you know that you can simplify: if($=1,0,1) ?
Use simply: 1-$ :)
2023-10-03 11:43
icon