void setup() { pinMode(6,OUTPUT); pinMode(7,INPUT); pinMode(5,OUTPUT); Serial.begin(9600); } void loop() { digitalWrite(6,1); delay(1); digitalWrite(6,0); int sure=pulseIn(7,1); int mesafe=(sure/2)/28.97; Serial.print("Olculen mesafe:"); Serial.println(mesafe); delay(1); if (mesafe<50) { digitalWrite(5,1); } else { digitalWrite(5,0); } }