int trigpin=11;
int echopin=10;
int echotravtime=0;
void setup() {
// put your setup code here, to run once:
pinMode(trigpin, OUTPUT);
pinMode(echopin, INPUT);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(trigpin, LOW);
delayMicroseconds(10);
digitalWrite(trigpin, HIGH);
delayMicroseconds(10);
digitalWrite(trigpin, LOW);
echotravtime=pulseIn(echopin,HIGH);
delayMicroseconds(25);
Serial.println(echotravtime);
}