Is it possible to repair an accelerometer? First of all, my device is a Moto E. It has fallen two times, both from bed height. So after the second fall, I noticed that my screen orientation stopped changing. I checked the "rotate screen automatically" option on settings and it was correctly set. I rebooted the phone hoping it would fix it but it didn't work.

I downloaded several apps to show the accelerometer's values, and they all show the same results: x and y are okay, but z, pitch, and roll, are stuck. Pitch and roll are stuck on 0, while z is stuck on -1.998.

The camera app is the only app that changes orientation, I'm guessing it is because it only reads x and y values.

I did a factory reset, but it didn't fix anything. I've seen some people suggest on forums that I reinstall the ROM or use a different ROM but I'm sure the problem it's hardware related.

So as it was caused by falling, there's no warranty for this. Is there a way this could be fixed? From what I've read, the fall could've caused the crystals in the accelerometer to break

So is replacing it the only fix? I know there are apps to force orientation changes, but that's not the point here.
I had the same problem. making sure my cover was secure, I dropped the phone from 3 feet onto a carpeted surface directly on the "5:00" corner (lower right side corner). It unstuck the accelerometer and it's now working normally.