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

The narrow seek capability

In our next iteration of the Controller, we program it to move completely along a straight-line segment, automatically correcting itself if it deviates slightly, by using narrow seek (or seeks). This involves significant changes to the Controller class, including deletions, so follow along closely. Also, note that all the code in this book, including all the iterations to Controller, are available online to download and peruse.

Code changes (Controller.java)

The first step in the code change is to delete the move() and seek() methods. They are replaced by the new methods naive_move() and narrow_seek(). Before we get to those methods, let me present the new methods to sweep in both directions:

 private boolean sweepClockwise(int ...

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