Tag Archives: Python

Arduino project for X-Plane 10

Recently, after wrapping my head around X-Plane’s plugin API, I embarked on my first journey into the Arduino Uno.  The Arduino Uno is a USB-based microcontroller board with 14 digital IO pins, and 6 analog inputs.  On Windows, the Arudino board uses standard USB COM drivers, so no need to fiddle with driver installation.  On my computer, the Arduino uses COM11.

As you can see, I wasn’t going for aesthetics.  The switch box serves as a functional proof of concept, and opens the door for future projects.

Arduino Uno and Other Hardware

Although I could have undoubtedly purchased lower cost parts on the internet, I decided to grab them from my local Radio Shack:

The Arduino Uno board:

The breadboard and microcontroller side-by-side:

As you can see, it can get a bit crowded, so organization is key.  I used the following system of organization:

  • Red – 5V power
  • Black – Ground
  • Green – Digital IO pin
  • Orange/Blue – Jumpers

Integration with X-Plane 10

I used two external libraries to integrate Arduino with X-Plane 10.  PythonInterface allows programmers to avoid having to compile C++ code, which makes debugging MUCH easier.  pySerial provides an interface between Python and serial communication devices, and has a very small learning curve.

In case anyone is interested in starting an Arduino/X-Plane project, I posted all my code on GitHub.  I will keep the plugin free and open source, and likely continue to improve it as long as I am using Arduino.  I still have some refactoring I want to do, so keep that in mind as you look at the code!

Well, that’s all for now.  I hope this has been somewhat interesting.  I’m open to questions, comments, and suggestions.  This is a learning process, and there’s always room for improvement.

Share and Enjoy

  • Facebook
  • Twitter
  • Delicious
  • LinkedIn
  • StumbleUpon
  • Add to favorites
  • Email
  • RSS