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
Xanth3r
From: Johannesburg, South Africa
Posts: 2
Hello all,

This is was touched on in another post by Simbird however I did not want to hijack his thread. I have successfully configured a potentiometer to control my spoilers, however in my setup the potentiometer only travels about 1/3rd of it's possible rotation and I need this to represent 0-100% spoilers. I know a potentiometer produces a value from approximately 0-1024, so I need Mobiflight to only register maybe 300-600, with everything on either side of that being deadzones.

pizman82 explained how to divide the potentiometer range into defined zones however how would I go about setting the deadzones? What might the code look like? Currently I am using the following formula: @ 16.0147 * 0 max 16383 min (>K:SPOILERS_SET). I've tried a few variations of IF statements but can't seem to get it.

Any help would be greatly appreciated! B)
2021-11-28 01:18
Avatar
simtcr
Posts: 12
Sorry, I don’t have answer to your question.

Just a thought.
So far, I have been using potentiometers for any input which has values 0% to 100%. Eg, mixture, propellor, cowl flaps etc.
Since, flaps are 3 (or 4 in some cases) static positions, I used 3 position toggle switch.
2021-11-28 06:16
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Hi

Technical we can build formulas here , too....
Its gonna be more difficult if you use the "mid area" of the Poti, in case you need to make calcualtions on "both sides".
Much more easy would be to use the Poti with the lower end as Zero Position !

So Poti "0" ( Most left) represent also "0" of your lever...... Poti in 33% Position represent 100% of Your Lever.....

Then all is just Math..... Poti goes over full Range from 0-1024 ...... We only use 1/3 Range.... So we simply can say "@*3"
Means when your lever is in your 100% Position then the Poti is only at 33% Position.... Means it have Value 1024/3 = ~~340 .... Now @*3 result in 1020 again.

May some adjustments are need..... E.g. you can also make a Deadzone on the upper end by.... if(@>340,1024,@*3) ..... So multiply Value by 3 to have the same increase 0-1024 BUT If Poti goes further stop at a hypothetical Result of 1024 Max.

*********

Alternates: Use a 3:1 Gear.... So your Movment of Lever move the Poti simply 3 times more..... then No calcs are needed.

For a Usage of the Poti in the MId Area you need Deadzones on Both ends....
Something like if(@<340,0,if(@>680,1024,(@-340)*3))
NOTE: Just Theoretical!!! I just want to show the logic !
Good Luck !
2021-12-02 23:31
icon