A quick sketch for getting the min and max X, Y and Z values for an accelerometer.