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 012Go to page 2Go to page 2
Avatar
Jeffrey_Pilot
Posts: 24
Hello guys,

I'm trying to discover how to make 3 way switches working with the PMDG 737.
Like the APU start, which need a OFF-ON-MOM switch and the Strobes/Nav light 3-way switch, down only Nav, middle Off and up the Nav and Strobes together.
I really have no clue what i need to setup to make this switches working.

The Event ID: 69750 EVT_OH_LIGHTS_APU_START. (OFF-ON-MOM)
and: 69755 EVT_OH_LIGHTS_POS_STROBE (ON-OFF-ON)

I hope you can help me! would be great.

Regards,
Jeffrey
2017-11-10 12:32
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 4989
Supporter
And WHAT is the question ??

You already got the correct EventID´s
Simply Create configs and set it !

Or do i missunderstand a Part ???

By the Way.... the Switch from the APU is pretty shure a ON - OFF - MOM and not a OFF-ON-MOM the "OFF" is still between the 2 ON Position in 99% of Switches !
Good Luck !
2017-11-10 13:41
Avatar
Jeffrey_Pilot
Posts: 24
Hi Pizman,

Thanks for your reply, yes i got the event ID, but how i have to set 3-way switches up in Mobiflight?
I have to fill something in by the parameter section in Mobiflight?
2 way switches I got working already.

And I my view it is OFF-ON-START(MOM) otherwise it goes off after you release the start switch. but correct me if im wrong
Regards
2017-11-10 13:58
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 4989
Supporter
Ahh sorry.... i not see this fact.

About the Switch APU...... In the Aircraft/Simulator it is a OFF-ON-MOM but that not means that the REAL Switch must be simmular..... The REAL Switch will be a ON-OFF-MOM.

For us it´s not important if a Real Switch is ON or OFF .... We Can simply say what it should do in OFF or in ON Position..... Whatever we set a switch inverted then we simply say Real Switch OFF should set Simulator switch to ON..... Or Real Swtich On should set Simulator switch to OFF.... Thats no matter.!

****

About 3 Postition Switches....

Here we got 2 Different logics.... Both will work, but if you like to use the "Mobiflight Synchro function" its recommend to work with ON-ON-ON Switches instead of ON-OFF-ON.
Otherwiese you can only use the Synchro Function aslong switch is in OFF Position.... Not in ON !
If you not plan to work with this Synchro Function then it is no matter.

1. ON-ON-ON Switches.
Here you got 3 Wires (Every Position is like a singel button).
Here you create a Input Config for every Position ( 3 configs) and define ON PRESS the EventID that set the Switch to needed Position.
(Normaly this EventID got a Parameter like 0-1-2 .... 0 Is Upper Position..... 1 Is Middle Position .... 2 is lower Position)

2. ON-OFF-ON Switches
Here we got the Problem that Middle Position (OFF) is NOT a real switch/button ... We only get 2 wires for the Upper and lower ON Position.
So we need TWO Configs here..... You Set for ON PRESS the EventID for the ON Position. on both Configs.
NOW you need a ON RELEASE, too. In Both Configs the ON RELEASE now will set the EventID for the Middle Position.

Then: If you push switch upper or Lower Position the On Press will execute the correct commend (Like in the ON-ON-ON logic) ..... If you Push the Switch to Middle Postion ( Whatever from Down to middle or Up to middle) then the Release of the last used Config will SET the Simulator to the Middle Postion finaly.

Hope now it´s working for you !
Good Luck !
2017-11-10 14:37
Avatar
Jeffrey_Pilot
Posts: 24
Hi Pizman,

Thanks for the help:)

But to be sure, for a 3 way switch I have to make 2 configs in Mobiflight,
1 three-way switch will go to 1 gnd connection and 2 different pins (11,12) for example on the board.

Regards
2017-11-10 14:46
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 4989
Supporter
If its a ON-OFF-ON Switch... YES...... Then you got 3 Wires... 1x GRD and 2x Data to 2 Pins..... Define As Dives on both Pins (For exmaple 11 and 12) a BUTTON !

Then Config 1 Use Button on Pin 11 .... On Press Action for Upper Position .... On release Aktion for Middle Position
Config 2 use Button on Pin 12 .... On Press Action for Lower Position ..... and on release action for middle Position
The On Release must be the same in both configs ! ... Cause whatever we switch to the middle from UP or DOWN .... Both must execute the same command.
Good Luck !
2017-11-10 15:27
Avatar
Apeshaft
Posts: 51
Supporter
Hi all,

Need some help, bought these:

https://www.ebay.co.uk/itm/5-x-ON-OFF-MOM-Mini-Miniature-Toggle-Switch-Car-Dash-SPDT-UK-Seller/183152967180?hash=item2aa4c47e0c:m:mnKXChblb0TUSyWH5ZAFxcA

They are SPDT ON/OFF/(ON) switches.

To use as APU start switch for the PMDG 737NGX.

Assuming the center lug is GND and the other two are data pins,
I connected them and assigned pins and set up two different configs,
one called APU on/off and one called APU starter.

For the APU on/off i chose eventid 66705 (APU_SWITCH_OFF)
for the On Press. Parameter 1.
For on release same eventid and parameter 0.

For the other config (APU starter, this is the momentary) i chose eventid 66704 (APU_STARTER)
for On press and parameter 1.
For On release eventid 66705 (APU_SWITCH_OFF) also with parameter 1
as I want the APU to stay on when the momentary input is released.

Unfortunately I get no response in the sim whatsoever, despite the inputs being registered by Mobiflight.

I would very much appreciate your take on this!

Best regards

Oskar
2018-05-17 16:30
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 4989
Supporter
Hi.

You use wrong eventID .....

iconQuote:

APU STARTER 66704
APU OFF SWITCH 66705


THESE are Standard FSX/P3d Events..... NOT possible for PMDG NGX

****
iconQuote:

PMDG Event : Nr. 118 :::::::: Name. EVT_OH_LIGHTS_APU_START ::::::::: EventID. 69750
For Parameter check the Output :
64FB 1 BYTE APU_Selector 0: OFF 1: ON 2: START


So Parameter is 0-OFF .... 1-ON ..... 2-START

*****
About Config .....
The First Button (Upper) is the static position ( OFF ) .... In this config you should use:
Press : Event 69750 Parameter 0 ::::::::::::::: Release: Event 69750 Parameter 1

the Second Button is the Momentary Lower Switch (START)
Here you need to try out....
For Press you need pretty shure Event 69750 Parameter 2
On Release is maby Tricky.... You need to test out this.

Option 1.... A Release is not needed.... Maby PMDG itself will swap back to position 1 after APU is started. Then you not need to set this youreself. MABY it is finaly wrong to set it cause "maby" you broke the starting sequence when you set it to "1 - ON" Yourself aslong start is in progress.

Option 2 ..... A Release is needed ! If for example after APU Start the switch is already in START Position ( Whatever you release your real button some times ago) THEN You need a Release command.... Use Event 69750 with Parameter 1 here

****
Summary... Try out what is better.... Maby you need to "hold" the switch some seconds like in real planes.
Please report experience for other users finaly !
Good Luck !
2018-05-17 19:31
Avatar
StephanHo
From: EDDG, Germany
Posts: 1785
Supporter
Hi all,

I did it the same way pizman told.

1st config
69750 upper position (APU off) Parameter 0 -> ON PRESS
69750 middle position (APU on) Parameter 1 -> ON RELEASE

2nd config
69750 lower position (APU start) Parameter 2 -> ON PRESS
69750 middle position (APU on) Parameter 1 -> ON RELEASE

It is always better to config on three-position-switches the ON RELEASE parts because you use 2 configs. So you leave config 1 with a defined level (Param. 1) and the same is if you leave the config 2 (also Param 1). Config one is not able to recognize the Paramter 1 without leaving config 2.

So I connect all bi- and tripolar switches. You have a defined Signal on every position.
prevents errors.
Grüße,
Stephan (Time: UTC+1)
2018-05-17 20:42
Avatar
Apeshaft
Posts: 51
Supporter
Reviving this old thread.

When it comes to simple on/off switches I have so far used ON-ON switches with three lugs, two for ON and one for GND. Then I have programmed each ON for either On or Off for the function in Mobiflight.

Would it be possible to use SPST switches?
I suppose it would save an input in the Arduino.
If so, would an if parameter be used or how should it be done?
2018-09-11 21:56
Avatar
StephanHo
From: EDDG, Germany
Posts: 1785
Supporter
Hi Apeshaft,

SPST switches are possible if they have three poles where the middle one is for GND. The switch react then as a ON-ON switch. Two poles make no sense.
Mobiflight did not save the input. MF notes at an input the there is a change and compare if there is a config and how to handle. Therefore, you do not need IF parameters unless you are referring to a value and want to manipulate it further.
Grüße,
Stephan (Time: UTC+1)
2018-09-11 22:58
Avatar
Apeshaft
Posts: 51
Supporter
I meant that you save an I/O pin on the Arduino, using only one pin and ground.

Also what i meant was this:

Create two configs:
One for ON.
If signal received: output ON (for example taxi lights ON).

One for OFF.
If no signal received: output OFF (taxilight OFF).

Would this be possible?
2018-09-11 23:24
Avatar
StephanHo
From: EDDG, Germany
Posts: 1785
Supporter
That is possible.

If you switch the button ON in MF then configure the tab ON PRESS. With your example you switch the taxi lights ON.
When then switching to the other direction you have to config the tab ON RELEASE - in your example taxi lights OFF.

No signal ist not possible because the MEGA does not have tri-state inputs. The firmware of MF activate to every pin so called pull-up resistance (built in the chip) to +5V.
If you switch you put GND to the pin and if you release you have +5V via the pullup on the pin. So the pin never is open.

This is done to have no indifferent voltages at the input and the data signals have defined levels.

I think we both mean the same, but I was so free to explain it to you technically. ;)
Grüße,
Stephan (Time: UTC+1)
2018-09-11 23:37
Avatar
Apeshaft
Posts: 51
Supporter
iconStephanHo:

That is possible.

If you switch the button ON in MF then configure the tab ON PRESS. With your example you switch the taxi lights ON.
When then switching to the other direction you have to config the tab ON RELEASE - in your example taxi lights OFF.

No signal ist not possible because the MEGA does not have tri-state inputs. The firmware of MF activate to every pin so called pull-up resistance (built in the chip) to +5V.
If you switch you put GND to the pin and if you release you have +5V via the pullup on the pin. So the pin never is open.

This is done to have no indifferent voltages at the input and the data signals have defined levels.

I think we both mean the same, but I was so free to explain it to you technically. ;)



Of course! Stupid me, I didn't think of the Onpress option. In that case, a positive effect of using SPST switches is that you can fit more stuff to the same Arduino board. Thanks a lot Stephan, will go ahead and order some SPST toggle switches now.
2018-09-11 23:43
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 4989
Supporter
iconStephanHo:

Hi Apeshaft,

SPST switches are possible if they have three poles where the middle one is for GND.



Can a SPST switch have 3 Poles ?? I always thought this MUST have only TWO . ( Only one circuit and only on "single" throw )
Good Luck !
2018-09-12 01:22
Go to page 1Go to page 012Go to page 2Go to page 2