Tilty ball: Controlling 64 LEDs and a 2-axis accelerometer

This example shows how to control 64 LEDs and read the input from two axes of an accelerometer on an Arduino.  The Arduino used here is a Duemilanove, but it will work on any of the models out there prior to the Duemilanove as well.  This example uses row-column scanning as a way to control more LEDs than you have output pins.  It also uses some of the analog pins as digital I/O pins.

Parts you’ll need

  • Arduino Duemilanove or equivalent
  • 2-axis accelerometer. I used the ADXL335 breakout board from adafruit.com, and only used two axes.
  • 8×8 LED matrix.  I used one I bought surplus.  See this post for details on figuring out your matrix’s pins if you don’t have the data sheet.
  • Breadboard or prototyping shield.  I used the proto shield and tiny breadboard from adafruit.com.

Continue reading “Tilty ball: Controlling 64 LEDs and a 2-axis accelerometer”

Using an Accelerometer to Sense Which Way Is Up

ITP just got some nifty flat panel mounts that can rotate 360 degrees. They’re very easy to move, it takes only one hand. When I saw them, I thought, “what good is a rotating mount if the content on the screen can’t rotate too?” So I came up with a little system to sense the screen’s rotation. Here’s how to turn those screens into a very big iPhone. Thanks to Michael Dory for his help in coding this and Dan O’Sullivan for the final clue.

The screens have a mac mini mounted on the back to display digital content. I added an Arduino with an accelerometer mounted on it to sense the angle of the screen’s rotation, then sent that data into Processing.  This example doesn’t do much, but the code can be re-used for any Processing application that needs to know the screen’s rotation.

Rory Nugent modified my existing code and made it much better.  I’ve incorporated his changes here, thanks Rory.

Continue reading “Using an Accelerometer to Sense Which Way Is Up”