Test code for motion sensor