viod setup() { pinMode(trigPin,output); pinMode(echoPin,input); serial.begin(9600); } void loop() { digitalWrite(trig pin,LOW); delaymicroseconds(2); digitalWrite(trig pin,HIGH); delaymicroseconds(10); digitalWrite(trig pin,LOW); duration=pulseln(echoPin,HIGH); distanceCm= duration*0.0340/2; serial.print(distanceCm); delay(1000); }