MakeBlock,
I would be interested to see sample code that uses the Ultrasonic sensor mounted on a servo - as shown in the GIF below…
This is the code I have used on my robot
The problem I experience is that the output varies, sometimes…
a) I got readings left and right but not center.
b) I get zero left, center and right.
c) I got the same reading regardless of what was in front i.e. variable value did not change.
In an attempt to fix the zero output I forced the program to loop until it got a value greater than zero from the ultrasonic sensor (making sure to reset the variable first).
This did not work for me either.
So I would be very interested in seeing a MakeBlock example.
Regards
Michael