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! 

Go to page 1Go to page 0123Go to page 2Go to page 3
Avatar
Ryan27679
Posts: 52
Hi, I'm pretty new to Mobiflight and Arduino, but I'm really excited about the capabilities of both.

I've done some work with 16X2 displays, buttons, encoders etc which has all been fantastic, but I'm hopeful someone can help me with this issue.

I'm aware I can toggle flaps down, flaps up by mapping 2 buttons to keystrokes etc, but I'd like to use a 4-way switch (like from a guitar) to have flaps up, and 3 positions down like the FSX 172. Each position on the switch would effectively be a button press. Is it possible to assign a button press to a position of flap?

I've looked through this and various other forums but due to my inexperience I can't quite make sense of it.

Thanks in advance,


Ryan.
2018-08-10 12:05
Avatar
StephanHo
From: EDDG, Germany
Posts: 1785
Supporter
Hi Ryan,

what you plan is possible. However, the prerequisite is a switch that has 4 unique positions that can be locked or rested. If I understand you correctly, do you describe a slide switch with 4 positions, right?

For the top position you use Flaps Up (EVENTID 65595), for position 1 EVENTID 65597, position 2 EVENTID 65599 and for Flaps Down EVENTID 65503.

So you set up 4 switches as devices and name them accordingly. Save the devices and save them to the module.

Then you set up 4 configurations as input.

1. Flaps Up module designation (with the corresponding devices, select device) Event ID 65595 Parameter 1
2nd Flaps Pos 1 Event ID 65597 Parameter 1
3rd Flap Pos 2 Event ID 65599 Parameter 1
4th Flaps Down Event ID 65503 Parameter 1

It must be ensured at each position that GND goes over the switch and the pin of the MEGA, but only if the respective position is selected.

Reports if it worked.
Grüße,
Stephan (Time: UTC+1)
2018-08-10 14:05
Avatar
Ryan27679
Posts: 52
Hi Stephan, and thanks so much for your response.

The way those switches seem to be laid out is with 4 separate points and a common ground.

Like this (if you select the 4-position one)
https://www.ebay.co.uk/itm/Oak-Grigsby-Switch-for-Telecaster-Stratocaster-Guitars-3-4-or-5-position/272646284599?hash=item3f7afc2537:m:mRdRqcV-63nOhYMUo4EaeeQ

I assume it will operate like 4 individual buttons, on 4 different pins as you say, and the position will be 'held' (not momentary) until the switch moves to the next contact.

I will order the switch and make an attempt as you describe!

Much appreciated!
2018-08-10 14:16
Avatar
StephanHo
From: EDDG, Germany
Posts: 1785
Supporter
Great, I think this switch will work!
Grüße,
Stephan (Time: UTC+1)
2018-08-10 14:19
Avatar
Ryan27679
Posts: 52
Fantastic, thanks so much :)
2018-08-10 14:38
Avatar
paul_max
From: United Kingdom
Posts: 74
Supporter
Ryan

The Strat has 3 pickups and the switch allows 5 combinations of the 3, like:
1
1+2
2
2+3
3

So it is not a 1 of 5 switch. It has 3 inputs and arranges 5 combinations of the 3 inputs.
There are multiple wafers also.

Paul
2018-08-10 16:02
Avatar
thatchi
Posts: 167
Not sure this switch will work. For 4 positions. Should be 5 connectors, one is GND or common, and 4 separate ones. So for up position, GND and 1 connected. For gear 1, GND and 2 connected. For gear 2, GND and 3 connected. For down, GND and 4 connected.
2018-08-10 16:09
Avatar
thatchi
Posts: 167
You can get a 6 position rotary switch and use 4 of them. But you have to turn a knob rather then sliding up and down. You may be able to reshape the above sliding switch' circular metal contact such that it can connect the common point and each other point individually, but you then have only 3 position to set up.
2018-08-10 16:22
Avatar
StephanHo
From: EDDG, Germany
Posts: 1785
Supporter
Paul,

it seems you've looked on the standard item if you call the website.

You have to expand the field "Positions" and select 4-Way, then you see the right item without overlapping the connectors.
Grüße,
Stephan (Time: UTC+1)
2018-08-10 17:21
Avatar
paul_max
From: United Kingdom
Posts: 74
Supporter
Yes the 4 position switch is the easiest, using 4 inputs.

But the 5 position switch has 3 signals mixed in a binary pattern:
001
011 // Mix 1&2
010
110 // Mix 2&3
100

3 inputs could decode that binary. That could do 0, 10, 20, 30, 40 degrees flaps for a Boeing.
For Airbus 0, 1, 2, 3, Full.

The 3 position switch suits the Cessna, UP, 10, 20. Also binary I think.

Paul
[Last edited by paul_max, 2018-08-10 17:57]
2018-08-10 17:52
Avatar
StephanHo
From: EDDG, Germany
Posts: 1785
Supporter
Paul,

you're right. But MobiFlight is not able to handle binary coded inputs.

By the way: a boing has 9 flap-detents: 0, 1, 2, 5, 10, 15, 25, 30, 40 ;)
Grüße,
Stephan (Time: UTC+1)
2018-08-11 00:52
Avatar
paul_max
From: United Kingdom
Posts: 74
Supporter
Stephan,

I think it is possible to use 2 "Preconditions" for two inputs on simultaneously (1+2, 2+3). Then it should be possible to decode the 3 inputs into 5 actions?

Checking my Strat guitar the slider switch will make a very tactile flaps control, like on small planes and the Airbus.
Maybe a 3-way guitar switch could do landing gear? Up - off - Down.

Well done Ryan for the creative idea of using a cheap guitar switch!

Paul
2018-08-11 12:00
Avatar
Ryan27679
Posts: 52
Haha sorry my budget is causing so much confusion!

From what I can see of those particular switches, the mixing (1, 1+2, 2, 2+3 etc) is done by having separate contacts on each side of the switch. Many of them have electrical connections on both sides. I only intend to use one side, so can bend/break the other ones to prevent overlap.

I'm getting stuck with a stepper motor at the moment so the flaps are down the to-do list a notch :(
2018-08-11 13:32
Avatar
StephanHo
From: EDDG, Germany
Posts: 1785
Supporter
@Paul

from this point of view with using preconditions you are right.

@Ryan

here's a tutorial on how a stepper works with Mobiflight. Although in German, but with the Google translator, everyone should be able to understand
https://www.mobiflight.com/forum/message/5649.html
Grüße,
Stephan (Time: UTC+1)
2018-08-11 19:52
Avatar
Gemu
Posts: 101
The easiest way could be an analogue axis with mechanical notches and calibrating flap positions in FSUIPC - works with any aircraft. Only one problem could be appear depend on Addon. If you use a virtual copilot like FS2Crew, the copilot may can´t change flaps. This I recognized this problem with IFly-737 (FS9). But with PDMG-777 FS2Crew can handle flaps independent of the position of my flap lever.
2018-08-11 22:24
Go to page 1Go to page 0123Go to page 2Go to page 3