Arduino + Accelerometer: Tilt Detection

Great post, thanks for sharing. I'm looking forward to trying this with an MMA3671L, which is 3-axis. I'm sort of unclear how you derived your constants (xy_max and xy_min). Were these part of the specification for your chip, or did you derive these experimentally by just tilting the board around and looking at outputs on serial? Thanks!