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
TRABANINO
Posts: 15
Hi,
I cannot fly over 32650 feet. It triggers an error. Is this normal or is there a way around?
I have FSX and Arduino Mega
2021-10-28 22:18
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
This is a Problem from FSUIPC and the way we read a Raw data fixed to ONE Methode.

A Integer Value can be SIGNED or UNSIGNED.

For example 1 Byte have a Range from 0 to 255 (Unsigned) or -128 to +127 (Signed) .
The Raw Data is the same for both..... Important is the way we READ it.
So for example 0-127 is same (whatever signed or unsigned) ..... But 128 is 128 in Unsigned BUT it´s -128 in Signed. ...... 129 = 129 or -127 ....


In the Altitude we also have this boarder at 32767. .... Means if we read Signed ( as we do) but the Offset is Unsigend in FSUIPC then a Altitude of 32800 feet and above is shown as a hudge negative value..... and can also occure in issues if you "write" it to the sim but the Software for sure not accept a negative Alt !

Solution: You need Formulas..... Something like IF Value is below 0 then add 65535 .
This solve the problem ! ( For sure a little more advanced if you make Inputs via Formulas (instead Events)
Good Luck !
2021-11-03 09:45
Avatar
TRABANINO
Posts: 15
Thanks very much.
I got your explanation and I didn't have to do anything.
I downloaded the new version of MF and my altimeter works without problem over 32650ft. Thanks anyway.

Could you tell me if there is a way to program in MF a 4 wires led? I would like to make a mesage panel where I could change the color of the led . By exemple, a critical message, where Red is danger, Yellow is warning and Green is Ok. For this I need to use PWM connections in Arduino Mega but the led divice in MF ask for 1 Pin only.
Thanks
2021-11-06 00:22
Avatar
StephanHo
Moderator
From: EDDG, Germany
Posts: 1867
Supporter
Hi Trabanino,

you are right, MF asks you only for one pin..

But remember, your LED with 4 connectors are 3 LEDs - so you need three pins. One pin for the red on, one for the green one and one for the yellow one.
The problem is yellow. Red and green are the normal colors of your RGB-LED and yellow is a mixed color of red and green.Ideally you should have a rgb led with common cathode. The series resistor(s) should not be set in the cathode line but in the anode line because the brightness may vary if you use two leds at the same time.So you need here two reistors to limit the current. The more current flows (i.e. the smaller the resistance is), the brighter the LEDs light up. I think, you will need 2 resistor in the range from 330 to 680 ohms. If your leeds are too bright ( you wants to built a message panel) they will dazzle you.

So you have to make also three configs.
The 1st is for the red led only with an intensity from 0...255, the 2nd is for the red and green with each an intensity of 0...255 (yellow) and the 3rd is for the green led with also an intensity from 0...255.
It's up to you that only one of these configs is active at the same time. Here you can use the precondition tab where you define a (pre)condition when the led is on.

One connector of your led (the blue one) keeps unused beause you do not need it for your colours.
Grüße,
Stephan (Time: UTC+2)
2021-11-06 00:50
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Stephan tell you the correct workflow.....
All this is possible with PWM and 3 Configs..... technical we can build all the 16 Million Colors by this technic !!!!

BUT

I will just remember how most people do....
Simply not use a RGB LED.

99% of Elements in a Cockpit ( rebuild of real gauges) only have one Color !
If a Announciator really have two colors ( Red/Green) mostly these are shown in different elements.
And Yes... ; The 1 % where only one indicator can be also red and green.....
Here most people simply set 2 Different LED´s ( with 2 Wires) and 2 Devices in MF.


If you like.... USe the RGB and build the Configs.....
But in my opinion its much more logical, easy and cheap to simply select multiple LED´s in the color you need.
So extreme .... A Red/Yellow/Green Warning Light..... Use 3 LED´s ( one Red, One Green, one Yellow) USe 3 Wires and one GRD and wire them to 3 Pins.
No PWM needed..... No calculation ..... No Logic.....
Just 1 Config for every LED!
Good Luck !
2021-11-06 02:27
Avatar
TRABANINO
Posts: 15
Thankyou for you explanation, I will try this method and will be back to you with my feedback.
2021-11-06 07:13
Avatar
TRABANINO
Posts: 15
I did it with 3 leds and it works perfectly. I built an Annunciator Gauge with 10 messages (30 leds in total). For each message and color, I created a config with an Offset and two others without offset to switch On and Off every led. I added a precondition to tell the led when it has to go ON and when to go OFF, making reference, each time, to the first config which is linked to the offset.
Thanks for your advice. If someone needs more detail, I will be happy to share it and write it down here. Also, if there is a better way, I will be happy to hear about.
Thanks, Raul
2021-11-26 14:41
icon