changed sensor

this code is for the accelerometer sensor
taken from https://gist.github.com/alexbain/8392153