added accelerometer sample code