Are you talking about the accelerometer that switches your screen in and out of landscape mode? If so go to settings, sound and display and see if orientation is checked or not. Either way, a battery pull could possibly resolve this.
I agree, settings / sound & display / orientation
However, physically pulling the battery is up for discussion. A lot of us come from Blackberrys where physically yanking the battery out was actually suggested by the phone's manufacturer and was needed. There has been some debate over the benefit or possible harm with battery pulls on Android devices. If what you want to accomplish is a "hard reset" - akin to rebooting the device... try this: Open the slider keyboard and press down (at the same time) control-alt-delete. The control key is the one to the left of the "Z" with an arrow on it.
What does this do? just like on a PC, it reboots. If something hinky is happeneing without any rhyme of reason, try the simple route first - reboot and THEN try more aggressive things. Have you ever called an IT department help desk? No matter what the issue is they ALWAYS ask, "did you reboot?".