Making character look where the phone is tilted

Hi, I’m new to Unity and I’m trying to make a 2d Android game where you tilt your phone to move the character (x axis only), but I want my character to look at the way he is moving and can’t find a solution to that. My character is by default looking at right (rotation 0, 0, 0), and when he is looking left the rotation is 0, 180, 0
Here is my script:

using System.Collections;
using UnityEngine;

public class TiltControl : MonoBehaviour {

	// Update is called once per frame
	void Update () {
		transform.Translate (Input.acceleration.x /3, 0, 0); 
	}
}

If 2D (as it looks), you’d have to flip the sprite to the direction it is moving.

float accel = Input.acceleration.x / 3f; // I'd change the 3 to a variable so you can change it by code.
if(Mathf.Abs(accel) < speedThreshold){ return; } 

this.transform.Translate(accel, 0f, 0f);
float scale = (accel > 0) ?  1f : -1f ;
this.transform.localScale = new Vector3(scale, 1f,1f);

Get the x acceleration.
Take the absolute value and check whether it is smaller than a define value. If smaller then quit the method. This is so that if the device is quite flat, the value may go above and below 0 really fast and your player will flip real fast too and move a bit jittery. This would require a certain amount of acceleration before it starts doing something.

Then pass to Translate (You’ve done that already) and check the polarity of the acceleration. If the value is negative, you are heading left, flip the x scale. Else make it positive.