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.