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,

I stumbled across Mobiflight a few weeks ago and really like it so far!

I am working on a switch panel with simple on/off toggle switches. I am making this for the Carenado Beechcraft KingAir B200. Previously, I worked with Link2FS and my Arduino Mega 2560 to assign my toggle switches to a certain pin and give them a "pull up" function. This worked fine for some of the switches in the sim. Now, I want to assign more functions to my switch panel and think Mobiflight is better to continue with. So, I looked at the sticky in the forum about the Lvars, and I understand the code (I have also got all my Lvars from the B200 via LINDA).

My question, how can I now code in my physical switches in lua to work with Mobiflight, FSUIPC and Flight Sim? I was personally thinking of creating some sort of virtual game controller that can be made with Mobiflight that can read the lua file in the modules file, and then be found by FSUIPC in FlightSim. This game controller will then be an Arduino which is wired to all my physical switches, then I just assign all the buttons via FSUIPC.

Hopefully you understand and any help would be much appreciated as I am stuck at the moment.

Thank you for your time.

Samuel
2017-02-09 11:40
Avatar
ojko181
Posts: 14
Hi there,

as I remember, you just have to write lua code, where you set which offset represents used Lvar. I used free offsets given in FSUIPC (66C0-66FF). Then you just have to assign physical button in mobiflight using offset you wrote in lua for each button. There is no need for any virtual controllers. It works simple just with mobiflight, fsuipc and lua. When you push the button it is read by arduino. Mobiflight knows it and sends the offset (for example "0x66C0"). Without lua it has no clue what to do with it because it uses Lvars. So if your code is written correctly it "transforms" offset to Lvar and that can be read by simulator and your airplane will do certain action.
2017-02-10 09:22
icon