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
Simbird
Posts: 6
Hello All:

First - thanks for Mobiflight and all your work maintaining and expanding the firmware.

I am using potentiometers for a Cessna 172 Flap Position Lever - 4 positions ( Up, 10 deg, 20 deg. and 30 deg).
Also - I am using a potentiometer for the Cessna engine key start - 5 positions (OFF - Right - Left - Both - Start).

Can I use the new analog feature for this application? Is there an analog preset for these?
The analog pot example should on line appears to be for a potentiometer used through a full range - for something
like a throttle for instance. But is there a way to capture specific settings - as in a four or five position lever or switch?

Appreciate any help you can give to help me configure this with Mobiflight. :)

Best Regards,

John
2021-10-03 20:19
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 5128
Supporter
Hi

Basically the most common logic is to use the system that is also used in the Sim !

Whatever Flaps Lever, Gear Selector or starting switch are "Multi Position SWITCHES" ..... Not Potentiometers!
A Poti is used to have a stepples 0-100% Value..... A System with 5 Positions is logical build by a switch also with 5 Positions in most easy way !
So our Poti Support is specialy implement e.g. to controll virtual Systems that are done also with a "virtual Poti" .... Like Dim Selectors, Volume adjustment, Temp Selectors and so on.

Whatever..... For sure it is possible..... But there exist no Preset ( and will not exist in the future pretty sure) in case this is very special and not used by most of the people!

Solution:
The Potis give a Input Value from 0-1024 ! ( Deadzones in the edges can exist..... So every Poti is different. May it goes from 5-1019 or from 15 to 1011 or so. )

So you can use a formula to define "Areas" .....
E.g. for Flaps Gauge as you requested you got 4 Positions.
0-1024 means 1024 Range..... Splitted in 4 Areas means 1024/4=256 .
So Area A: 0-256 .... Area B : 257-512 ... Area C: 513-768 ..... Area D 769 - 1024

Lets say you would write a Offset to 0,1,2,3, ......
You use formula : if(@<257,0,if(@<513,1,if(@<769,2,3)))

Other example: Offset request a Value from 0-16383 for the Flaps Setting ( 0=Up .... 16383 = Full Down)
Here we could use a "Multiply" ...... 16383/1024 = ~~16 ...... So Formula @*16 change our Poti Value form 0-1024 into roundabout 0-16383
Means it now work steppless directly.

***********
In easy words..... The Poti give a Value 0-1024 ..... And you must use a formula to create a Output Value ( That is executed to the sim) in a way you need it !
Good Luck !
2021-10-05 14:25
icon