How to implement input from device accelerometer and gyroscope?