raschemmel is correct.
I am using this accelerometer, ADXL335. I know that on a flat surface, the XYZ axis' spit out something like this (305,455,435) in the serial monitor. I then tilt it to find the full range of motion for each axis. Then once I have the ranges, I map them. I have a fluid level and a protractor to help with the angles and any offsets it may need to be accurate.
What the accelerometer does is cancel the command of the light being on when the accelerometer reachers center. Which in this case is between +2 and -2 figures are an example because I don't know how they actually calculate it
This sounds like a state change machine, the accelerometer is tilted in a certain direction, then brought back to its original position, the led that corresponds to the angle it was tilted to gets turned off.