라즈베리파이 초음파 거리센서 ULTRASONIC 1 #include #include const int pinEcho = 1; const int pinTrigger = 0; int main(void) { wiringPiSetupGpio(); pinMode(pinEcho, INPUT); pinMode(pinTrigger, OUTPUT); digitalWrite(pinTrigger, LOW); delay(30); while(1) { digitalWrite(pinTrigger, HIGH); delayMicroseconds(20); digitalWrite(pinTrigger, LOW); while(digitalRead(pinEcho)==LOW); long startTime = micros(); while(digi..