Arduino + Accelerometer: Tilt Detection

So, I did this using just the X and Y accel pins from a 5dof board (IMU Analog Combo Board - 5 Degrees of Freedom IDG500/ADXL335 - SEN-09268 - SparkFun Electronics), and had to recalibrate the xy_min and xy_max to:

long xy_max = 300;
long xy_min = 350;

...but got it working!

I did the recalibration by just examining the serial output for each pin as I moved the board in space and noting the values as I moved it: