Accelerometer Help

Hey Board,

I'm trying to use either a Memsic 2125 or Analog Devices ADXL320 Breakout (from sparkfun) with the Arduino. The accelerometer will be in the center of a plexiglass cube and I need to figure out how to detect orientation and tilt. For each position, left, right, up, down, roll, etc. I want to control some LEDs. I can figure out the LEDs easily if someone can help me figure out how I can isolate the proper values from the accelerometer. I need help with concept/code for either not both. Alternatively, I have the option of using a Hitachi H48C as well. Any help is greatly appreciated. I can also communicate via IM or IRC.

Thanks!

well, for the tilt you could, when the arduino sketch starts record the current reading of the acceleromter and set that to 'Flat', then if the cube was tilted the arduino would be able to tell which way it was by comparing the current value to 'Flat'