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.

Go to page 1Go to page 1123Go to page 3Go to page 3
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Kai´s Diagromm show a ON-ON Switch....

You have 2 Ways.... You can use just one of these Pins.... Then PRESS means switch is that position ..... RELEASE means the switch is in the other position.
For sure you can also see this switch like 2 single switches ( And you create 2 Devices in MF )
Then you need in theory 2 Input Configs... Both use only on Press now.
BUT
Technical this is not needed..... One would be enough !
Good Luck !
2022-03-21 12:18
Avatar
MKTango
Posts: 19
I tried 100 time and still dose not works LED is always ON..:scared: :scared: :scared: :mad: :mad: no way to turn it off.. anyone can give me a hand? Thanks in advance

Marcelo
2022-03-21 23:00
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
On last request you ask for the INPUT system.... and you say your LED will NOT light.
NOW you tell us your LED light all the time.

Please try to SPLIT Hard and Software.

At first find out if all Pins are as expected and are wired correctly to the MEGA and also in MF all Devices are set correctly to the needed Pins.

How to do....

Wire it... And set devices in MF and upload them to Board.
Then Start MF (WITHOUT start RUN Mode) ..... Enable the "Logging Mode" in Settings to Typ DEBUG.

THEN.....

1. Moove 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.

2. Confirm LED is working.
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 !

If those test was fine we know 100% your Hardware is correct, and the Problem is within the Configs.
If tests are not sucessfull we know you have a wrong Device Setting or a wrong wirework !
Good Luck !
2022-03-22 00:56
Avatar
MKTango
Posts: 19
iconMKTango:

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



My bad.. where I said "..but no light..." is ALWAYS LIGHTS.. always ON.., works in my panel ( msfs) but in my switch light is always ON.. Ill try again.. ur advice.. sorry for misunderstand.. english is not my language..

Marcelo
2022-03-23 02:00
Avatar
MKTango
Posts: 19
iconpizman82:



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

[Last edited by MKTango, 2022-03-23 02:28]
2022-03-23 02:21
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
At first.... I´m Sorry ! :blush:

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 :
iconMKTango:


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.
Good Luck !
2022-03-23 09:53
Avatar
kjoussen
From: Hamburg, Germany
Posts: 178
The picture of the show KDC2-22 Switch shows a momentary switch.

The latching switch is sold as KD2-21
2022-03-23 14:04
Avatar
MKTango
Posts: 19
iconpizman82:

At first.... I´m Sorry ! :blush:

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 :

iconMKTango:


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.



Thanks a lot for you time.. i did and follow what you wrote.. button working ( MF test) and plane.. LED works ( MF test on/ off) but not in plane.. weird... almost lack of ideas..

Marcelo
2022-03-23 22:18
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
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 !
Good Luck !
2022-03-24 00:08
Avatar
MKTango
Posts: 19
iconkjoussen:

The picture of the show KDC2-22 Switch shows a momentary switch.

The latching switch is sold as KD2-21



I think this is my problem.. I managed to LED work. and button works now, BUT ( always is a BUT),, when I keep button pressed, . LED turn ON. , and when I released. LED turn OFF.. means. is NOT A LATCHING switch.. . so never ill get LED stay ON if the button turn off " by it self.." I am correct??... I think those guys send me wrong switches.. ideas?

But guys. I am learnnig a lot., about MF. thanks for your help!! ( my wife is not happy.. lol).

Marcelo
[Last edited by MKTango, 2022-03-25 19:44]
2022-03-25 19:26
Avatar
MKTango
Posts: 19
iconpizman82:

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 !



I normally tried in standard planes.. like 747.. any chance to let it work in P3d where my PMDG is intalled?

Marcelo
2022-03-25 19:28
Avatar
kjoussen
From: Hamburg, Germany
Posts: 178
If the hardware can't do it, maybe MF with it's logic possibilities....

Here https://www.mobiflight.com/forum/message/22037.html is described how to use a momentary switch as a latching switch.

Hope that helps.
2022-03-25 23:23
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
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 !
Good Luck !
2022-03-26 10:04
Avatar
MKTango
Posts: 19
iconpizman82:

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 !




ok iam building MCP737, hardware is done.. now, I am connecting ALT_HOLD switch I can not use PMDG, cause is not ready for MSFS2020, so have to use a generic plane from microsoft , this case 747. My switch pin (bottom left) is connected to Pin 2 ( PWM) 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), set On Press ( Set Value=1) or On release ( Set Value=0) . My LED Switch is in output config. set as pin ( my case 29) in display, and in Sim Variable I use fsuipc preset ' Autopilot-AP altitude HOLD", with offset of 0x07D0..
:confused: :blink: :blink: :blink:
[Last edited by MKTango, 2022-03-26 11:58]
2022-03-26 11:15
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
You mix up a lot of things and do mistakes!

You can NOT mix guides and logics over 2 different Sims and also not over 2 different Aircrafts/AddOns.

The picture show the Guide from Karl ( 737DIYSim) . Its for the PROSIM B737 on P3D
So its absolutly wrong for a Stock Aircraft that is oincluded in the Sim ( Your 747) and its also absolutly wrong for FS2020 cause it was build for P3D

You also not understand what a value is....
iconQuote:

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)


0x5300 is the ADRESS of the Data ... NOT the Value !
The Value is 1 or 0 !

Also your LED is wrong set.
AP Altitdue Hold is 07D8 .... 07D0 is Altitude LOCK.

And finally.... For FS2020 it is not recommend to use FSUIPC Offsets..... Here we use SimConnect Variables! ( You can use FSUIPC, too but it is not verry usefull and logical)

***************

Solution: For Input use FS2020 Events ..... For Output use FS2020 Variables (In Dropdown of Typ of In/Output)
Mostly these Stock aircrafts use the "Generic" Stuff. So check this Groups with SEARCH for "ALT"


***********

Summary: You need some more basic knowledge. E.g. that 0x07D0 is a Hexadecimal Number... So it is a OffsetAdress. Without understanding this basic things , its hard to build a cockpit !
Good Luck !
2022-03-26 12:48
Go to page 1Go to page 1123Go to page 3Go to page 3