Example script to read accelerometer