Open tawjaw opened 2 years ago
The ultrasonic sensor always has a distance. In the robot environment, if an object is not detected it sets the distance to be the maximum distance.
However, if the echo is not detected back the echo pin wouldn't change and then something like
duration = pulseIn(echoPin, HIGH);
would time out.
The ultrasonic sensor always has a distance. In the robot environment, if an object is not detected it sets the distance to be the maximum distance.
However, if the echo is not detected back the echo pin wouldn't change and then something like
would time out.