This app was mentioned in 6 comments, with an average of 1.67 upvotes
Your accelerator might be broken. Try an app like this one
If that doesn't work, it is probably a software problem. A factory reset should work..
Install Accelerometer Analyzer (https://play.google.com/store/apps/details?id=com.lul.accelerometer&hl=en) and make sure that one of your axis is actually locked (for me to was the z-axis but who knows!).
The next part is not really technical, but I read it somewhere and it worked for me. Take your phone out of the case, hold by the base and smack it firmly against your palm. The app should show all three axis moving again!
The idea being to de-stuck the gyro.
This has happened to me a couple times, and this has fixed it every time.
TL;DR Smack it
https://play.google.com/store/apps/details?id=com.lul.accelerometer&hl=en
I tried both of those apps as well as the direct sensor read-in from a default utility, same effect.
Try using this application and see if the accelerometer is reporting back properly. https://play.google.com/store/apps/details?id=com.lul.accelerometer
There are plenty of apps to access the accelerometer. Here's one for android.
https://play.google.com/store/apps/details?id=com.lul.accelerometer
try this app before resetting accelerometer test