Archive for the ‘Flight Sim’ Category

SimConnect Switch Panel

Monday, December 11th, 2006

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.

First Panel

Wednesday, December 6th, 2006

This is my first effort at building a cockpit panel for use with flight simulators. It is a basic bottom panel, modeled loosely after a Cessna 172.

panel-build-set-1-009.jpg panel-build-set-1-006.jpg
The panel Closeup of small switch

The only switch left to add is the magneto/starter switch in the blank space on the left side. I will probably build my own, based on this product. Check out the brochure link at the bottom of the page for construction details.

panel-build-set-1-008.jpg
I was pleasantly surprised to find a split toggle switch at my local electronics surplus store to use as a battery/alternator switch.

panel-build-set-1-015.jpg

Here is the USB interface portion of the excellent (and free) MJoy16 controller I am building on some .100″ perfboard.

Update

IT WORKS!!!!!!
Thank you Mindaugas Milasauskas!

Dec 6 17:21:13 winchester usb 1-1: new low speed USB device using ohci_hcd and address 47
Dec 6 17:21:13 winchester usb 1-1: device descriptor read/all, error -110
Dec 6 17:21:13 winchester usb 1-1: new low speed USB device using ohci_hcd and address 48
Dec 6 17:21:14 winchester usb 1-1: configuration #1 chosen from 1 choice
Dec 6 17:21:14 winchester input: www.mindaugas.com MJ16 as /class/input/input3
Dec 6 17:21:14 winchester input: USB HID v1.01 Joystick [www.mindaugas.com MJ16] on usb-0000:02:00.0-1
Update 2
The links above are now search farm. Here is a mirror for now: http://www.powernet.pl/~krzysiek/elektronika/mjoy16/mjoy16.htm