void setup ()
{
pinMode (trig, OUTPUT); // Config pines and zeroing the echo pin
digitalWrite (trig, LOW);
pinMode (echo, INPUT);
Serial.begin (9600); // Démarage Serial at 9600 baud
}
void loop ()
{
digitalWrite (trig, HIGH); // Send a pulse of 10 microseconds
delayMicroseconds (10);
digitalWrite (trig, LOW);
time = pulseIn (echo, HIGH); // Measure the length of the return pulse
distance = time / 58; // Aplique the conversion formula in centimeters
Serial.print ("Distance ="); // Write in the series window Remote
Serial.println (distance);
delay (50); // Repeat the operation every 50 millisecond
}