const int echo = 3;
const int tring = 4;
void setup() {
Serial.begin(9600);
pinMode(tring, OUTPUT);
pinMode(echo, INPUT);
}
void loop() {
digitalWrite(tring, HIGH);
delayMicroseconds(10);
digitalWrite(tring, LOW);
int tempo = pulseIn(echo, HIGH);
int dist = tempo*0.0172;
Serial.println(dist);
delay(1000);
}