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
tango67180@gmail.com
Posts: 4
I have a range of RPM that I want to use LED's to indicate. The first range is <16,000 and I turn on a yellow LED off when it goes below and off when it goes above. Works great.
The third range is when RPM is >16,500 and I turn on a red LED and off when it goes below 16,500. Works great.
The second range is >16,000 and I turn on a green LED. Works great until the RPM goes over 16,500 and I have both a green and a red LED ON when all I want is the red ON.
I have tried numerous preconditions and logic schemes but I have not succeeded.
Anyone know how to extract a range of values to control an output?
2017-09-13 22:34
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Hi

For This you can work with lots of different systems !

Basicly every LED got a own Config ( But use the same Raw Data like the other Led´s)

For Red and Yellow LED you use a simple Compare....
You can say for Yellow IF Value Less then 16000 <16000 THEN 1 ELSE 0
Or You can work inverted.... IF Value is bigger then 16000 >16000 THEN 0 ( Here you not need a ELSE or you can simply use $ for Else) . Always note.... A LED will light everytime the Value is not Zero.... It light with value 1 but it light too, with value 2, 3, 555, or maby 9999999.
Both will work..... In Some special situations when you need the Config for another preconditions then the second methode is maby better.

So your only Problem is the Green LED cause you not know how to tell it the "BETWEEN" Range.
Here i will give you 3 Soulutions.... Please use the mothode you fell more comfortable or that is much usefull for you.
The FIRST is the best..... I Just show you alternates so you can understand the technics !


1. With only ONE individual Transform IF Function

Say in Transform IF Value is Bigger then 16000 AND Smaller then 16500 THEN Value should be 1 ELSE it should be 0
Transform entry is .... if($>16000&&$<16500,1,0)

2. With a Transform - Compare Combination
In transform you define ONE End (The Lower for example) .... The OTHER End (The upper for example) in the Compare Tab.....
In Transform you say IF Value is smaller then 16000 THEN Value Should be Zero ELSE it should be shown the original Value
Transform entry is ..... if($<16000,0,$)
In Compare Tab you say IF Value is bigger then 16500 >16000 THEN 0... ( No Else is need again or you can set simply $ there)

3. With Precondition
Here you must remember the Basic Rule... A LED must be controlled EVERYTIME by a config.... If You just disable a Config the status of LED will not change itself !
For a Precondition System you also will need TWO Configs for the Green LED. 1. Config Work if it should be ON..... Second Config is need to Set the LED OFF until Red LED is ON.
1. Config use the Offset of the RMP..... Compare If Value Bigger 16000 Then 1 Else 0 ( That manage the ON Status )
Precondition in this Config is " Only Work if "Config of RED LED" Value = 0
2. Config can use every offset you like.... Simply use the same like in the Other..... Compare here is IF Value is 1... THEN 0... ELSE 0 . ( So it´s always Zero)
Precondition in this Config is " Only Work if "Config of RED LED" Value = 1 ( Or much better here is != 0 instead of 1 That protect you of issues in difficult systems)
Now GREEN Led set to OFF everytime the RED Led is ON.

Please just think about that..... All Systems work and get own benefits even in what situation you want to work with.
Good Luck !
2017-09-14 01:40
Avatar
tango67180@gmail.com
Posts: 4
Thanks! Great way to enter a conditional into the logic. I was trying to test the first procedure and my connector configurations all changed themselves which is really weird.
2017-09-14 03:27
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
icontango67180@gmail.com:

I was trying to test the first procedure and my connector configurations all changed themselves which is really weird.



Sorry i not understand..... What is changed by itself ?? Other configs ? If there another problem please explane more detailed what is happend !
Good Luck !
2017-09-14 13:28
Avatar
tango67180@gmail.com
Posts: 4
HI pizman,

I could not test your method becuase I lost control of my panel. Some switches worked and some went from ON state to ON state instead of ON to OFF. What I discovered is that the DuPont connectors that are used on the Arduino Sensor Shield are just garbage and if you move the Mega/Shield a around a few times wires start disconnecting from the posts on the shield and even worse some of them stay on the post but no longer make reliable electrical contact. I fixed all this by tearing apart my panel and rewiring everything to solder connections. What a struggle - took a while day.

I did implement your suggestion on transforming and it works wonderfully well. Wish I had figured that out myself but I didn't and I am grateful that you steered me in the right direction.
2017-09-15 15:58
icon