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!
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.
I followed that diagram. and still just efect, or action, but no light.... means I have to use two button one for released and one for pressed? ex. 42 and 43?.. maybe I am doing something wrong in my mobiflight program.. huff any help I will appreciate..
Marcelo
THEN.....
1. Move Your button.
Confirm the logging show Button 1 Press in upper position.... Button 1 AND Button 2 On Release in middle Position and Button 2 on Press in Lower Position.
My switch is momentary on/off.. ( middle? position?, lower position? is a KD2-22. two position on or off not latching..)
2. Confirm LED is working. ( always ON)
Create a Output Config.... No mater what Offset/Variable.... Just get to the DISPLAY Tab and select your LED and press the TEST Button in the Display Tab ( NOT the Test Button in mainbar.)
Confirm LED goes ON and goes OFF when you stop the test by click the TEST Icon again !
no matter what i do . is always On.... wire from volts to 5v ( with resistor) , second wire ( just below) to pin ( 47 in my case).. and shared gdn connectors to GND.. 3 wires.. that's all..
I am newbie.. for sure missing something, I can not figure it out.. once my issue is cleared , I can program, 14 switch left.... and jump to encoders.. I know.. is complicated..
I
no matter what i do . is always On.... wire from volts to 5v ( with resistor) , second wire ( just below) to pin ( 47 in my case).. and shared gdn connectors to GND.. 3 wires.. that's all..
At first.... I´m Sorry !
I mix up 2 topics ( awnserd a other user shortly before who had a 3 way ON-OFF-ON Switch). Sorry for confusing you!!
This show me definitly that it is a ON-ON switch !
I not know if its "latching" or "momentary" .... But we can see from this Picture that each position of this switch have a own Pin. So it must be a ON-ON
About Switch Logic:
Switch need a wire from your used Pin on Mega ( e.g. Button on Pin 10) TO the Switch lower LEft Pin ( On Picture named "Connected when pressed" )
Also you need a GRD for the Switch..... Here Wire goes from Switch Lower Right Pin (named "Button Common" ) TO a GRD Pin on the Mega.
You can in theory also create a second Button Device on the MEga and wire it to Lower Middle Pin (in Picture labeld "Connected when released" )
BUT as i said... We not need a ON-ON. We can handle it already with the one line.
****************
About LED:
HERE we got the Problem :
no matter what i do . is always On.... wire from volts to 5v ( with resistor) , second wire ( just below) to pin ( 47 in my case).. and shared gdn connectors to GND.. 3 wires.. that's all..
You can NOT wire a LED to 5V !!! Then its always ON!!
You must wire a LED to a Arduino Pin and define THERE a LED Output Device!
So E.g. Pin 12 on Mega is set as "LED" ...: Wire From there ( via a resistor) to LED Input on the Switch ( Named (LED 3V) on the Picture.
And a GRD for the LED ( From Switch Pin "LED GRD" ) to Mega GRD
(As you said.... You can share these 2 GRD ( From Input Switch and LED together... Both to same GRD Pin on Mega)
*************
Summary:
You need in Mobiflight TWO Devices.... 1x Button Input and 1x LED Output.
And you need 2 Config Lines....
One INPUT Config that detect Switch command and send it to the Sim....
AND
One Output Config that read e.g. the Status of Sim Autopilot and controll your LED to ON or OFF in relation if the Virtual AP is On or Off.
The picture of the show KDC2-22 Switch shows a momentary switch.
The latching switch is sold as KD2-21
If you confirm the LED is working ( test mode in MF) then electrical all is fine......
If you also confirm the Input is working then there is a Sim connection pretty sure ( If your switch work with a Event/Offset.... if you use a "keypress" then we not know it)
You can 100% confirm this by read a basic Output....
E.g. the COM1 Frequency in a stock aircraft
If Mobiflight show data in the Output Collumn related to the current COM1 Frequency you also confirm that Output basically work.
So....
If you can NOT Confirm there is a Sim connection we need to check if your FSUIPC (older Sims) or your WASM ( FS2020) is working fine.
Otherwise. If you can confirm a working sim Connection ( i expect this) THEN
The Issue MUST be in the Output Config.
Maybe you read the wrong Data. Wrong Adress of Offset, Wrong FS2020 Variable.
Specialy if you use a "non stock aircraft" like a Addon ( e.g. FBW A320) the needed events are different to the standard ones.
Here you need to tell us exactly.... What Aircraft and Sim you use. Then we can guide you to the correct Output Data.
And not forget... A Output Config must be activatd by the checkmark on the left.... Else it can not work !
Guys.
Its no mater if the switch is latching or not.... The LED have no relation to the switch..... In theory the LED also can be 2 Meters away from switch.
Also the LED must not show the same system like you controll with switch....
E.g. switch can be set to Gear Controll..... And LED show the Status of COM1 Radio.
I expect your issue is you use the wrong Output Data!
PMDG mostly have TWO Offsets for most of the systems.... One show the Status of the Virtual LED ..... The other show the Position of the virtual Switch.
Sure... If you read by mistake the virtual Switch ( instead to the virtual LED) then your LED will light exactly as you said.... Its ON aslong the virtual switch is ON.
And its OFF aslong the virtual switch is OFF.
And again here the Latching/Momentary of your Button is not important.... Its important if the virtual switch is latching or not.
**********************
Solution:
Simply tell us WHAT you like to do.... We still know its a PMDG. So tell us what system you like to build ( e.g. the MCP Flight Director Switch )
Also tell us what EventID you use for your Input Config ( And also if you use just press or also a release)
AND
Tell us what Output Offset you use in your LED Config.
Im 99% Sure the problem is you not already understand the basic logic how Inputs and Outputs work !
and set as input with FSUIPC off-set. ( Autopilot AP Altitude HOLD) with a value of 0x5300 ( value take it from pic, or 0x07D0 by default, not works either)