const int trigPin = 11;
const int echoPin = 10;
void setup() {
Serial.begin(9600);
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
}
void loop() {
digitalWrite(trigPin, LOW);
delayMicroseconds(4);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
long t = pulseIn(echoPin, HIGH);
long cm = t / 29 / 2;
Serial.println("Distance=");
Serial.println(cm);
delay(500);
}