Added tilt sensor code