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 012Go to page 2Go to page 2
Avatar
StevenT1972
From: United States
Posts: 12
I created my own annunciator panel. I would like to turn off all the LED's with the master battery in the cockpit. Setting an additional script for every LED seems like too much work.
When using preconditions, the LED that was on will not go off if the precondition is false.
Is there a way to do this?
As an alternative, the panel is wired with common ground. Is there a way to turn off ground through some pin, or do i need a transistor?

Thanks,
Steven
2018-01-14 23:09
Avatar
albeagle
Posts: 142
Hi there Steven. You can't turn off all leds by cutting off power, because the max7219 chips need to initialize which means they have to be powered on all the time. You have to do it with preconditions. You have to create two values for each display and say if switch A is on then display value X, if switch A is off then display " " empty characters and the display will be blank.

AlbEagle
Regards
AlbEagle

https://flyingforfun.weebly.com/
2018-01-14 23:55
Avatar
StevenT1972
From: United States
Posts: 12
No not a Max7219. Just regular red LED. I have a matrix of 36 red and green LED's. each one from its own pin. example one is for high engine rpm, one is for the parking brake,
one for fuel pump being on, etc.
I'm using one ground for all of them and each LED has it own pin out to turn it on.
I want all of them to be turned off when the master battery is off.


Steven
2018-01-15 03:00
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Hi

Its the same situation on LED like with Max7219 Displays.....

Basicly you must know... WHAT does your Aircraft support on the Offsets..... Does it show the Status of the virtual LED ... OR... Does it show the status of the function ?

Simple example.... On PMDG the value of the ALT Display is 1000 .... Whatever the Master Battery is ON or OFF.... So if Battery is OFF and the Display in virtual Cockpit is Off, too.... The Value of the Offset is STILL 1000 !!!
Same is in PMDG for the LED..... The Flightdirector LED show if its ON..... If you Disable the Master Battery then the FD is still on in the internal System and the Value is still "1"

Simmular problem you got with the LIGHTTEST Function..... Here its reversed....
If you push the LightTest Button then all "virtual" LED light up.... But the Offsets not change..... If LED is normaly OFF then Value is still "0" Whatever it light at the moment in case of the test!

So Question: What Aircraft do you use.... And how does it support this on the Offsets ??

****
Solution:
You need TWO Configs for EVERY Output ( To realise the "OFF in case of Battery " situation) ... OR You need THREE Configs each to additional simulate the Light Test Part.
Example:
Config 1 Read the real Offset Value .... precondition A) Only work if Battery = 1 AND precondition B) Only work if Lighttest = 0
Config 2 is ZERO All time ( Compare If 1 then 0 else 0 ) ... Precondition Only Work if Battery = 0
Config 3 is 1All time (Compare If 0 then 1 else 1 ) .... Precondition A) Only work if Battery = 1 AND Precondition B) Only work if Lighttest = 1

Now C1 controll normal Mode.... C2 Blank if Battery is off.... and C3 Light up if Lighttest is Active ( And Battery is On same time)

EDIT:
A disablewith PRecondition ( and without a second config) is not possible.... if you just disable the Config then the LED stay in the last status ..... You MUST have a second config that tell the LED it should get Off !
****
Alternate:
You can use a Relais to cut the GRD Line from Board to the Hole LED . Get shure no switch is on the same GRD !!

***
Last note.... In the future we think about a new precondition System that make this much more easy.... But this is in early Beta status and take some time !
Good Luck !
2018-01-15 23:07
Avatar
paul_max
From: United Kingdom
Posts: 74
Supporter
This is where the simplicity of MobiFlight hits a limit.

With SIOC you can code a single script to cope with global values that affect everything. There are examples that cope with battery and the test switch.
But this is beyond the capabilities of most users.
2018-01-17 10:27
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
You give the awnser yourself....

iconpaul_max:

This is where the simplicity of MobiFlight hits a limit.
With SIOC you can code a single script....



Mobiflight is build to prevent the user of scripting......
So problem is we can not implement everything ... Cause if yes then the grafic Interface of Mobiflight is much more difficult like learning scripting finaly.

****
You can get the same result on a Mobiflight System with own scripting, too.... Simply create a LUA Script and implement it youreself in FSUIPC....
You can for example Read ALL LED Offsets.... And make a precondition like " IF Offset of Battery = 0 THEN ALL Offsets should be change into 0.... Else they show there current readout state". With a ElseIF you can implement the Lighttest, too.

****

My personal planing for the future is to implement a "Variable" System in Mobiflight that can be used in the Expressions.
Then we can define global for example "X" = Value of Batteryswitch (1 = ON 0 is OFF)
Then for example in a LED Config you use in Transformfield.... if(X=1,$,0) ###That means if BatteryVariable is 1 (ON) THEN show current Value ELSE show 0 all time.

With two variables like X = Batteryswitch and Y= Lighttestswitch you can work, too...
Here it is for example if(X=1&&Y=0,$,if(X=1&&Y=1,1,0)) ###That means if Battery is On and no lighttest then show current value.... If Battery an AND Lighttest show 1 ELSE show 0.

I realy hope Sebastian can handle this in the future.... Maby Variable is not global and must define like the Placeholder in the LCD Config.... But this will save us hundrets of duplex configs.
Good Luck !
2018-01-17 20:24
Avatar
paul_max
From: United Kingdom
Posts: 74
Supporter
Looking again at this post, a power mosfet could switch the common ground of LED outputs.

That could emulate a "master battery" bus, with hardware limitations.

Paul
2018-08-09 21:52
Avatar
StevenT1972
From: United States
Posts: 12
Used a relay to cut the common ground to the LEDs. Have it turning on with battery master.
Works like a charm.
2018-08-16 20:14
Avatar
ec-cts
From: Pozuelo de Alarcon, Spain
Posts: 79
iconQuote:

Used a relay to cut the common ground to the LEDs. Have it turning on with battery master.
Works like a charm.



Do you do it with the Max7219?

The relay how do you connect it? directly or through a resistance?

ec-cts
Carlos
[Last edited by ec-cts, 2018-08-18 16:59]
2018-08-18 16:53
Avatar
paul_max
From: United Kingdom
Posts: 74
Supporter
Carlos

Directly - the relay behaves like a simple switch. By routing all LED, motor and 7 segment gnd connections to one side of the relay and the other side to GND on the power supply, all those devices can be disabled simultaneously.

EDIT:
Max7219 chips cannot be disabled unless the CLK signal is disabled which indicates power down mode. However signals from MobiFlight would be ignored and lost. So Master Battery ON event would have to clear all digits.

Cheers
Paul
[Last edited by paul_max, 2018-08-18 17:48]
2018-08-18 17:27
Avatar
ec-cts
From: Pozuelo de Alarcon, Spain
Posts: 79
Excuse me, keep asking.

I do not get it. I have max7219 of this style:




Of course with a mega2560

if I always have to have the vcc and the gnd connected, do you mean to change this gnd through the relay?

Thanks again
[Last edited by ec-cts, 2018-08-18 17:51]
2018-08-18 17:46
Avatar
ec-cts
From: Pozuelo de Alarcon, Spain
Posts: 79
Forget about my previous question then.
So you can not use this method in max7219?

Or you have to disable the clk (disconnecting it?)
2018-08-18 17:55
Avatar
paul_max
From: United Kingdom
Posts: 74
Supporter
Carlos,

See my reply above. You could turn off all Max displays with GND relay switching, but all digit values would be lost.

But when turned on every digit would be blank (the default I think). Digits may have to be set to special values during the Battery On event, like 000.

Paul
2018-08-18 17:55
Avatar
ec-cts
From: Pozuelo de Alarcon, Spain
Posts: 79
It is understood.
The problem is in the ignition, which would not return the values that could have in the simulator. Is that so?

And if so, have you tried in any way to re-take the current values?

I am currently using it with preconditions, but it is not stable.
I turn off and turn on all the displays, remembering the values, but I do not turn off all the displays, some leave them on and do not turn them off, or on the contrary when you turn them on some will not turn on unless you change the value of the frequency what show.

regards

Thank you

Carlos
[Last edited by ec-cts, 2018-08-18 18:08]
2018-08-18 18:01
Avatar
StephanHo
From: EDDG, Germany
Posts: 1867
Supporter
Hi together,

please also have a look to this

https://www.mobiflight.com/forum/message/9776.html

topic.
Grüße,
Stephan (Time: UTC+2)
2018-08-18 21:31
Go to page 1Go to page 012Go to page 2Go to page 2