def getAccelerometerValues function for accelerometer script