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
TheIrishAviator
From: Ireland
Posts: 11
Hi all,

I have successfully figured out how to use preconditions to make multiple uses out of the one display panel i made with 2x 7-segments thanks to your help on here and from heading past forum posts, however I have run into an issue that I cannot get my head around, it seems like something simple so hopefully one of you can help solve it.

Basically, everything is working i.e I have a toggle button to switch between Com1 or Nav1, a rotary encoder with a pushbutton to control mhz and khz and a Xfr button to switch between active and standby frequency.

However, my issue is that once I push my toggle button to switch between Com and Nav, I cannot switch back to the first display. So if im on Com1, i toggle the switch which suits the preconditions i have set and it enables all my Nav displays and controls, but i cannot toggle back to Com1 thereafter.

Just to add, the output value does change back from 1 to 0 and 0-1 etc.. but in the simulator and also the display segments, they remain on Nav and dont change back when the output does.

All help is appreciated, I've attached some pics to help make it clearer.




Toggle Button Settings
[Last edited by TheIrishAviator, 2021-01-25 19:31]
2021-01-25 19:21
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Hi

Please contact me in Discord if possible.

As you expect... Pretty sure just a little detail. But i can not figure out the problem with the given screenshots in case i not see all important tabs.
Good Luck !
2021-01-26 18:55
Avatar
jaimeleon
Posts: 26
Hello everyone,
I am very new to Mobiflight, although I have been a fan of MSFS for three decades. I was trying to figure out how to toggle different pages on one 20x4 lcd screen and found this solution explained very well what I was looking for. However, what if you want to toggle more than two pages?

I thought I'd share this to help anyone facing the same problem. Following is the simplest code I came up with and it seems to work well. As in the solution posted before, a button is setup in Mobiflight as an input to set a value that is stored in the 0x66ff offset of FSUIPC7. This value is later retrieved as a dummy output that is used to evaluate a precondition to display each page. It can easily be modified for any number of pages. Pushing the button will rotate through the pages on the lcd display and loop back to the first page. Just replace the code in the InputConfigWizard of the button, More Options, Set Value box to

if($<4,$+1,0)

That's it for five pages (0 to 4). This will increment the value stored at 0x66ff by one every time you push the button up to 4 and set back to 0 on the next button press. You will need to setup the preconditions for each of the five pages to match each value of this variable.

Sorry I could not post a picture of the setup. I could not figure out how to paste it on this post.

Regards,
Jaime
[Last edited by jaimeleon, 2021-03-09 04:10]
2021-03-09 04:03
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Hi Jaime.

Thanks for your Posting. :thumbup: :)
Whatever...: This is explaned many many times already..... Your posting show me that lots of people still not find it!

About Logic:

If we use a Multi Position switch ( Rotary Switch or so) then it´s easy..... Each Position send ON PRESS a single Value. Most LEft e.g. "0" next nodge send "1" and so on.

If we use a momentary Button ( Like yours) we got a lot of possible ways.
Basic logic as you said.... The System must set the Value "back to zero" if we would override the highest number we need.

For your System: We need 5 Modes ( 0,1,2,3,4 ) we can use:

if($<4,$+1,0) ( As you recommend)
if($=4,0,$+1) ( As i use lots of years)
if($>3,0,$+1) ( Same again just other syntax)

($+1)%5 ( Thats the most easy formula)
It Add 1 to the curreent value..... The Modulo% divide the result by 5 and show the rest if a divide is not possible....
E.g. Raw "1" means 1+1=2 ... 2%5= 2 ...... But if Value is still 4 then 4+1=5 .... 5%5=0


You see. Lots of possible ways.... And all will work !
[Last edited by pizman82, 2021-03-09 15:04]
Good Luck !
2021-03-09 14:57
icon