code to work with the gyro and accel