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! 

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