void setup() {
// put your setup code here, to run once:
pinMode(A0,OUTPUT);
pinMode(A1,INPUT);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(A0,LOW);
delayMicroseconds(3);
digitalWrite(A0,HIGH);
delayMicroseconds(10);
int i;
i=0.0172413793103448*pulseIn(A1,HIGH);
Serial.print(i);
Serial.println("cm");
delay(800);//0.0185
}