EasyManua.ls Logo

Makeblock mBot2 - Obstacle Detection and Avoidance; Ultrasonic Sensor for Distance; Obstacle Avoidance Logic

Makeblock mBot2
22 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
13 | P a g e
F. Avoid or Seek
The Ultrasonic Sensor is used to measure the distance between the mBot2 and anything in front of it (up to about
200cm). It can be used to avoid obstacles or seek out an object and move toward it.
The minimum distance detected is about 4cm. Smaller distances give a reading of 300.
Test your Ultrasonic Sensor with this code. Putting all the sensor reading code into a function unclutters the main
loop.
Obstacle Avoidance

Related product manuals