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! 

Posts: 2
I'm trying to connect an OEM A320 ECAM control panel where the LEDs in the buttons are common anode... I can see there is a previous question about using common anode, where the response is that Mobiflight is designed for common cathode, but the answer suggests inverting "the logic by setting it to "0" if you want your LED to shine and "1" if you want it to turn off". I can't see exactly where to do this - do I need to edit some code or can it be done within the Mobiflight software interface? Sorry for my ignorance but can anyone help?

The software is great - it's just frustrating that the ECAM configuration is not common cathode!

2020-05-28 07:01
From: ETSI, Germany
Posts: 4465
Welcome to Mobiflght !

Yes this is possible in most situations.
Mobiflight set a Pin to 5v (High) if a LED should be ON and to GRD if it should be OFF.
In your case you need it inverted.... So you wire the Common Anode to a 5v Pin and the Cathode side to the specific Pins.

In the Configs you need now a logic that "invert" the System.....
I not know the AddOn you use and if Offsets are Boolean (1/0) or if you work with Bitwise Offsets..... Whatever the follow should work in all situations.
Way A: Use transform enabled and enter the formula "if($=0,1,0)" ..... Means if Value is 0 set to 1 Else set to 0.
Way B: Use Compare Tab Enabled. Say If Value "=" "0" THEN 1 ELSE 0 ( Same result.... just without using a formula)

Maybe Stephan can comment this later..... I don´t know if the 5V Pin got a lower Limitation..... With a shared GRD we can work up to 800mA..... But i don´t know how many LED are recommend on a single 5V Pin. Specialy if multiple LED are ON same time like in Lighttest situation.
"Maybe" the save way here would be a external power Suply.... But lets wait for Stephans reply !
Also remember you need also resistors for each LED !
Good Luck !
2020-05-28 07:17
Posts: 2
Thanks for helping - I have just used the transform option and it is working now!

I haven't been using the simulator parts for a long time so I am just trying to get things working again before starting construction. At the moment I am still using AirSimTech AST, with FSX and FSUIPC. I only need two LEDs to be lit at once because in the OEM ECAM panel there are two LEDs per button. Resistors are built into the OEM circuit and I am looking to power each of the LEDs from a seperate Arduino pin. Arduinos are fairly cheap so I will buy more if needed.

To control the lights I am using the info from AST such as "LIGHT=ECAM Led BLEED Fsaddr:4820 Bit:1". I've added this using the entries into the Output FSUIPC tab as Offset 0x4820. I made my own circuit to test it with the software before starting to wire up the OEM panel, which is when I found it was common anode!

Thanks again for helping so quickly!!
2020-05-28 08:01