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.

icon
Avatar
Boeingmanaic27
Posts: 9
Dear all,

Been working on a B200 simulator for some time now. Add-on aircraft I use is the Carenado B200.

I am now working on the Annunciator panel and have stumbled across a problem.

Question: How do I control a LED on the Arduino when operating a switch?

Example: when GEN 1 switch is off, "L DC GEN" light illuminates and vice versa. How would I configure this in Mobiflight.

I have checked FSUIPC offsets as well as Lvars to see if there is a "L DC GEN" but I have had no luck.

If anymore information is required, please let me know. Thank you in advance!

Samuel
2018-01-25 11:28
Avatar
gmcallis
Posts: 28
I think you would need the offsets for that particular aircraft, which you should already have if you can correctly configure a switch. Remember, switches are inputs and eventid's while leds are output and require offsets.

I'm no expert tho I've used Mobiflight quite a deal so I hope the above is helpful.

Cheers

Graham
2018-01-25 11:56
Avatar
Boeingmanaic27
Posts: 9
Graham,

Thank you for the quick reply, I was thinking too difficult! I just had to assign the same offset in output (for the LED) that I have in input. Then when I toggle the switch it also turns on the LED. However, I use Event ID's for several switches, how would you then control the LED without the offset.

Samuel
2018-01-25 12:13
Avatar
StephanHo
From: EDDG, Germany
Posts: 1867
Supporter
The manufacturer of your addon should publish two lists. The first with the offsets to read something from the sim (i.e. LED etc) and the second a list with the EventIDs for using switches encoder rotary etc to be able to make settings from the outside on the sim.

If these lists do not exist or the manufacturer will not publish them, it would not be possible to control your sim from the outside.

Only with these lists you can control switches and LEDs. You can use the tutorials here in the forum to lear how to do this.

Another thing is that you need FSUIPC in the latest V4.x Version.
Grüße,
Stephan (Time: UTC+2)
2018-01-25 12:21
Avatar
Boeingmanaic27
Posts: 9
Has any one had experience obtaining these lists from Carenado, I can not find any on the internet.

Samuel
2018-01-25 13:06
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Hi

I Not use "Carenado" !
But if you not find anything..... then it maby not be existing B)
Not every AddOn is designed for Homecockpits.... Then its verry difficult or not possible to make this working !

Question.... HOW do you make the Inputs ?? Do you just use Keypresses ? Or do you set "Offsets"
If you use Offsets WHAT Offsets ?ß Special own Offsets form this AddOn or standard offsets. ??

About your detailed question....

Basicly Mobiflight not work with "self build logics" in the Outputs... you NOT can say... If Button A us pushed THEN LED Xy should light.
A Output is based ALWAYS on a readout Offset....
So your LED not light in case of the button.... It light cause Simulator tell it that it should light ! Simple Example.... If You Push the Button while Battery is OFF.... Then it can not light in the Aircraft,,,, But it will light in your System cause you have pushed the button !

Finaly.... You can improve lots of things.... With own code or with elctrical solutions.... BUT Best way is to work with a AddOn that supports ALL Data you need on FSUIPC Offsets !
Good Luck !
2018-01-25 20:11
Avatar
Boeingmanaic27
Posts: 9
Hello Pizman,

Thank you for the explanation. I do use the standard offsets from FSUIPC as well as Event ID's to control switches. I have got most of the engine gauges working with the standard FSUIPC offsets (ITT, Turbine RPM, Torque, etc.). The only problem I now face are the Annunciators because from what I have gathered so far, there are no offsets for these.

An example:
Offset 0x3101 = Alternator(1). In my B200 this controls Generator 1. Assigning an LED to this is easy because it has an offset.

However,

Alternator 2 has no offset, but I do have Generator 2 in my B200.
There is an FSX command for Alternator 2 which is: "TOGGLE_ALTERNATOR2."

Is there some way I can control the FSX commands or the event id's to control LED's or MUST it be done with the offsets?

Samuel
2018-01-29 08:54
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Hi again....

Some AddOn Aircrafts are still using a part of the original Offsets. ( For example nearly all AddOns use GEAR or ParkingBrake from standard table)
If there exist no offset they build a own solution. ( Some Professional Addons build this solution for nearly all things, whatever a Offset is existing they don´t use it and make there own)

Now question is.... How do your AddOn make it. And Do they support it for you ?

About your question.....
iconBoeingmanaic27:

Hello Pizman,
Is there some way I can control the FSX commands or the event id's to control LED's or MUST it be done with the offsets?



That not can be awnsered general.... Thats individual !

Basicly....
EVENTID can NEVER be read !
OFFSETS can have three status..... READ ONLY...... WRITE ONLY ..... READ AND WRITE
A Input Offset is always writeable..... But sometimes not readable ( Like in DataPipe Systems) .

So you have to check your used offsets in the lists if they are readable ! If Yes you can use this Data to build a LED logic....

Another way to make a improvisional logic ( For non readable offsets or eventID) is to use Customoffsets for this.... In that case you write a empty Offset and tell him what position you switch have in your homecockpit. And then you can read out this offset for a LED..... Simply like "IF Switch is ON THEN LED is light.... Switch OFF means LED is OFF.

Third way is to make this electrical..... You can use 2 pole Switches and controll a LED independent from the Simulator.... So your switch controll Function ON/OFF via line1 in Mobiflight..... and It controll via Line2 direct a LED. Then LED is ON always if switch is ON

But AGAIN: This is not perfect.... this mostly only show you that a button is ON or OFF..... But a anauncioator can light in different ways....
For example if your Fuel Pump is ON.... That not means the Low Pressure Light is OFF all the time ( Normaly yes but the light will come again if you have low fuel for example.... When you only work with the Switch Logic then your LED not show the real state of anaunciator.... It only show your improvisional logic you define youreself !

******
I will recommend.... Check out your AddOn.... Talk to other people that use it and build Homecockpits with it to get more information !
Good Luck !
2018-01-29 10:38
Avatar
Boeingmanaic27
Posts: 9
Hello Pizman,

Thank you again for the explanation. I will try to ask others that have worked with this addon before and maybe even contact Carenado directly to ask for more information.

Samuel
2018-01-29 10:52
icon