I would download one of the play store apps that monitor your accelerometer (just search accelerometer on the play store) and see if they record any movement. If they don't it is probably a hardware issue, if they do it is definitely a software glitch and might need a factory reset to fix ( after backing up of course)