SimConnect Switch Panel

I don’t have pictures yet, but(see below!) the switch panel is wired and functioning with the exception of the magneto/start switch (which is yet to be built). This weekend I wrote a small program in Visual C# Express to interface the MJoy16 with Microsoft Flight Simulator X using SimConnect. Most of my programming has been in C or various scripting languages such as PHP, Perl and Bash so I needed a helping hand to get started in Visual C#. NotASenator from the Avsim forums has a nice SimConnect tutorial series started and I followed that with no problems. I added some joystick button code and FSX events to the basic framework NotASenator created and was up and running this weekend.

The only problem I have now is some strange behavior with the TOGGLE_MASTER_ALTERNATOR event. The toggle behavior doesn’t seem to match other events. Right now the alternator switch only works correctly if the battery switch (TOGGLE_MASTER_BATTERY) is toggled.When I get that investigated further I’ll post an update.

Call me a freak, but flipping a switch on a control panel and having the flight simulator react is very, very cool. Especially after all the soldering that was required. 🙂

My prototype main form code, very rough in zip format.

All you real programmers out there, don’t panic when you see it…

Note that this prototype code is hard-coded to my particular joystick setup and is provided as an example only.


Pictures

panel-build-set-2-001.jpg panel-build-set-2-002.jpg
Humble Beginnings Prototyping at its best
 
panel-build-set-2-003.jpg
Diodes Everywhere

The 3 black things on the blue thingy glued to the 2×4 are 50K slide pots. Some day they will be linked to proper throttle, pitch and mixture controls. 😉 This is all just proof of concept at the moment, I’ll get around to building something a little more permanent later.

4 Responses to “SimConnect Switch Panel”

  1. Mike Powell says:

    Very nice to see a flight sim project dealing with FSX that carries all the way through from the physical switch toggle to code to SimConnect to FSX.

    Hope to see more.

    Mike

  2. Paulo says:

    Hello, do you still have the Not a Senator tutorials?

  3. Sorry, I did not keep a local copy and it looks like the site is no longer maintained.

  4. john doe says:

    I didnt understand what point of this. you have avr joystick you can add buttons on your flight simulator.but if thats not work as real joystick then propably. solution would be buy teensy and do joystick working sample allready done then just add buttons from simlulator as you do other joysticks, but if you want read airspeed com channel etc.. then propably c# is nice. and teensy read write everything on xplane

Leave a Reply