Tag Archives: Arduino Uno

How to create a trim indicator for X-Plane using Arduino

After successfully implementing switches, buttons, and LEDs with the Arduino microcontroller, I decided to take on servos.  Please forgive my makeshift indicator, which was constructed using a post-it note!  I am still looking for a good method for creating something more professional and open to suggestions.  The code is good, but the aesthetics are still undoubtedly in the “proof of concept” phase.

As you can see, the servos will work out of the box for the most part.  Each servo requires power, ground, and a digital pin.  To compensate for the USB output, I drilled a circular hole using a 5/8″ drill bit.  If you have more precise tools, you can make this as pretty as you want.  Personally, I would have preferred the USB output extend from the rear, but to accomplish this we would need some kind of female-female 90-degree connector, or a larger project box.

Required Hardware

Source Code

Arduino

 

PythonInterface

 

Share and Enjoy

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

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