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 112Go to page 3Go to page 2
Avatar
kbumbaz
From: Nice, France
Posts: 15
So, as said before it works. Here how.

- one encoder RADIO_SEL
* rotation > update a dummy FSUIPC Offset from 0>COM1, 1>COM1, 2>NAV2, 3>ADF and 4>XPDR.
* push > swap from ACT to STB if COM1 NAV1 or NAV2 and each digit for ADF & XPDR
- one encoder FREQ_SEL
* rotation > increase a part of frequency
* push > swap from integer to decimal frequency change and vice versa
So this allow me to interact with all number to change. Nothing new here.

For each COM1 NAV1 NAV2 ADF & XPDR
I build a new output COM1_TXT NAV1_TXT etc ... where I build my super number with both frequency ACT & STB ($+1000000 trick in Transform field). For ADF & XPDR it is a simple copy. Again Nothing new here.

So now lets combine the value of RADIO_SEL & pre-prend a star in from the TEXT should be mark as selected.
For each COM1_TXT NAV1_TXT NAV2_TXT ADF_TXT & XPDR_TXT I create its brother with suffix _SEL (COM1_TXT_SEL ... where I will concat a* or a space) How:
Each of this output reads the same offset as my RADIO_SEL (so it is from 0 to 4) and in compare I have IF current value = 99 (so never) set 0 else if($=0,'*'+#,'_'+#)
  • _ is a space
  • 0 is replaced on each of XYZ_SEL with his meaning value from 0 to 4


On my LCD I have this template with placeholder XYZ_SEL

iconCode:
COM1# ###.##  ###.##
NAV1§ §§§.§§  §§§.§§
NAV2? ???.??  ???.??
 ADF@ @@@ XPDR- ----


And ... it works like a charm.
A few pics







PS: Just need to find a smart way to play with ADF because I have only place for 1 freq.

Thank you all! Thanks again.
[Last edited by kbumbaz, 2021-01-05 22:38]
K.
2021-01-05 22:31
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
:thumbup: My complimen!

Now you see the deepness of the Formula tool. With a little "push in right direction" you was able to build this.

Basicly also the "rudimentary" solution was working ( 5 Display Configs with Precon) . Now we get a more advanced logic and other users can "see" the system.

In Theory now the next (last) step for a programmer would be to simplify the system ! In the past we do this to save memory, increase running speed of a programm or so.
Today this is not realy needed cause as i know from Helimech ( the most advanced B737 with Mobiflight) a Cockpit work fine also with hundrets of Configs !

So decide yourself if you like to stop now ( cause your system work as expected) OR if you like to make it smarter.

For example:
You understand now that you can combine the STAR and a Variable Value by using *+# in the compare section
Means in theory also the combination of COM1 and COM1Stby could be done this way. So you could save the "combine Config" by doing this in the "star config" .
Lets say you use here #=Com1 and §=Com1Stby .... Then '*'+#+§ should looks like *#####§§§§§ finaly.

*******************
Summary: Play again if you like.... Or enjoy your result as it is !
Good Luck !
2021-01-06 10:00
Avatar
kbumbaz
From: Nice, France
Posts: 15
Hey pizman82

Yes I will go for improvement, of course. I used to switch off the light 4 times to make sure it is off (can't sleep otherwise). :w00t:
I am thinking to build a small button box with basic stuff so my MF will remains a kids toys compare to other monsters.

POC is done and is a success. Now it is time for wood working... and it is not my speciallity :(

Last question, only one LCD is possible per Arduino, without external power ?

Thanks thanks thanks again for your help.
K.
2021-01-06 16:29
Avatar
Hortax
From: LFST, France
Posts: 19
Supporter
iconkbumbaz:

Last question, only one LCD is possible per Arduino, without external power ?



I use two 4x20 lcd without external power, No problem

2021-01-06 17:16
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Hi again.

From Firmware side.... 2 Displays per Mega. So 2 Megas means 4 Displays.... 3 Megas means 6 Displays and so on.

Electrical i never try out but Hortax still confirm my opinion.... So 2 Displays should work ASLONG you not have many many other power consuming devices on the same Mega.
Here basicly we use the same calculation like always.....
Check your Datasheet of the Displays and/or use a Multimeter to find out the power usage of that stuff.

I personal work with these limitations....
1. 500mA max for all devices on the Mega.
2 200-300 mA max for a single device that is powerd via 5v Pins (Displays, Motors or so)
3. LED max 20mA per LED ..... better are low current LED.

And like always.... Try to split Power / Devices logical. If you need 30 consuming Parts and 40 Button/Switch/Encoder Inputs..... Then use 2 Megas and try to make 15 Outputs and 20 Inputs each. ..... Same for Displays. If you already need 2 Megas in your Element.... And you need 2 Displays then use one each.

Simple policy ( for my own opinion) is share Power and also share CPU workload of the Mega as best as we can.
It make no sense to use e.g. all Buttons on a Mega ( that must work maybe just every 2 Minutes) .... And same time we use 50 Outputs on a other Mega that need to handle e.g. a Motor every second.
Same argument for MAX7219.... Chains work.... But increase Processor usage and maybe occure in delays if they get verry long.
If needed build a 8x Chain. But if you still got free Pins then make shorter chains or set Displays single !
Good Luck !
2021-01-07 14:34
Avatar
kbumbaz
From: Nice, France
Posts: 15
Thank you both for your feedback.
K.
2021-01-10 08:35
Go to page 1Go to page 112Go to page 3Go to page 2