Simplest way to get the current state of a control?

I’m using Flight Sim 2020

I’m setting up a custom cockpit, and I have built a bunch of rocker switches for controlling various aspects of the plane, like parking brakes on/off, view cockpit/external, dash lights on/off, play/pause, etc.

All of it ties into a Teensy 3.5 running the keyboard/joystick library and these particular buttons are attached to keyboard commands.

My problem is that they get out of sync. Suddenly when I flip the switch to play it pauses, when I switch back to pause it resumes, the dash lights are on when the button is set to off, etc.

Is there a way to make it closed loop? Is there some simple interface into Flight Sim (serial?) that I can use to determine what FS thinks the state of the button is? I know there’s a huge SDK and a whole world of customization available to a good C++ programmer, but I really am not that.

Thanks for any direction you can provide,

DougM

Take a look at http://www.stryder-it.de/simdashboard/help/en/For_PC_Gamers/Game_Configuration/Microsoft_Flight_Simulator_(2020)
Seems to be the official way??
Good luck

Or better: [(SimConnect Client - FSEconomy Operations Guide)]
If you are familiar to C# there are some examples: https://csharp.hotexamples.com/de/examples/-/SimConnect/-/php-simconnect-class-examples.html
It seems you to be ahead of me, I am currently trying to set up such a cockpit, but in theory I have already encountered its problems. I see it as having to run a program on the PC in the background that reads the settings from the simulator via the SimConnect interface and forwards them to the microcontroller of your cockpit via USB or serial interface. I’m pretty familiar with C #, but I think I need a LOT of time to do something like this.
20 Minutes later: But now you have really grabbed me. :wink:
I want to take a closer look tomorrow, maybe there is already a solution:
https://github.com/mcashatt/RoadrunnerSimconnect

@ChampionFlea226 thanks for the pointer, now I have something to do over the long weekend :slight_smile:

I’ll post back how far I get.

Thanks!

DougM

1 Like