int i=0; unsigned long pulseTime = 0; onds unsigned long distance = 0; unsigned long distancia = 50; int angulo=0; int sentido=0; int LED = 8; in 8
// stores the pulse in Micro Sec
// Red LED, connected to digital PWM p
long ultrasonico(){ digitalWrite(initPin, HIGH); delayMicroseconds(10); urning off digitalWrite(initPin, LOW); pulseTime = pulseIn(echoPin, HIGH); hould be high as the pulse goes low-high-low distance = pulseTime/58; convert to cm. return (distance); }
// send 10 microsecond pulse // wait 10 microseconds before t // stop sending the pulse // Look for a return pulse, it s // Distance = pulse time / 58 to
Thank you for interesting in our services. We are a non-profit group that run this website to share documents. We need your help to maintenance this website.