Default [Q] Auto-Rotate not working...

So this must be my week of bad luck. I fixed one problem and now auto rotate will not work on any application. It is checked in settings. I'm running clean rom 5.6.

EDIT: Just tried Liquid smooth and it's not a rom issue same problem won't auto rotate...

Double EDIT: I downloaded android sensor box and it looks like it is a hardware problem. Wish me luck...

TRIPLE EDIT: Okay so I messed up a flash on clean rom and when I fixed it auto rotate works..... Don't ask me