What is an Accelerometer and how it Works

Ever wondered how your smartphone automatically switches from portrait to landscape as you tilt it, able to point out the direction in…