O'Reilly logo

Lego Mindstorms EV3 Essentials by Abid H. Mujtaba

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Obstacle-avoiding robot

Now, for the pièce de résistance, we have the obstacle-avoiding robot. We will start by describing the functionality we wish to achieve and then we will figure out how to achieve it.

Desired functionality

The sequence of actions (functionality) we expect from the obstacle-avoiding robot is as follows:

  1. On activation, the robot starts to move forward in a straight line.
  2. The LEDs flash green.
  3. When an obstacle is encountered, the robot stops.
  4. The LEDs flash red.
  5. The Stop sound is played.
  6. The robot moves backward for 2 seconds.
  7. The LEDs flash orange.
  8. The robot makes a right-hand turn (90 degrees), turning in place.
  9. The LEDs continue to flash orange.
  10. Forward motion is resumed until the next obstacle is found. Essentially, the entire process ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required