Try *#0*# (I don't know if that works on Motorola phones) to see if you get the test screen. If you do, press Sensors. If not, install a sensor test app that includes the accelerometer sensor. Edit: I was typing that while Cant Miss was posting, I guess.)
Watch the x and y numbers. From portrait to landscape they should just about exchange values. If they're not doing anything, you've got a faulty sensor, it's covered under warranty, and wherever you bought it has to replace the phone (which eventually gets back to Motorola and they have to eat the repair cost). Part of the price you paid for the phone includes a replacement warranty, so you're entitled to a replacement, you're not asking for a favor.
(If the accelerometer is working, try what Motorola suggested.)
But back up
everything in either case. Replacing the phone and doing a factory reset have something in common. any data you entered into the phone, and any apps you installed, are lost. I suggest
Helium (you'll have to download a little Windows program and connect the phone to the PC to get Helium to run on an unrooted phone - the link to the program is in the app, it'll tell you). Make sure that when you back up, you
uncheck the "data only", so you're backing up the apps too (so you don't have to waste time downloading them again). Do the backup, then copy the backup folder (it's named carbon - that's the old name of the app) to your PC, because either a factory reset or a new phone will not have the folder.
And you should always have a current backup of your phone on your computer and on a cloud account (at least one - there's no such thing as too many backups).