Accelerometer main method