Plane | Corrective Balancing Mechanism

First of all, here’s a video of this device in action.

 

So things are really starting to take shape with the plane (still unnamed…) and I’ve got a really solid framework for an auto-balancing system. Basically the program below maps the x value given from the ADXL335 to a value from 1-180 on the servo. A lot of this code is for debug, but that portion can be switched off.

Sorry for the lack of comments in this code, it’s pretty intuitive though, at it’s core its all about the map command.

Here’s a picture of what my desk looks like:

Here’s a picture of the fritzing document, which can be found: here

Thanks for reading!

Hey! This post was written a long time ago, but I'm leaving it up on the off-chance it may help someone. Proceed with caution. It may not be a good idea to blindly integrate this code or work into your project, but instead use it as a starting point.