gets speed and time from accelerometer.