How to add tilt controls to move left and right for mobile?

How to add tilt controls to move left and right for mobile?
Tilt device to the left to move to the left and tilt phone to the right to move right.