This code is modified from the Adafruit calibration code to allow calibration of the accelerometer through serial data input to avoid additional hardware setup.