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.
The first step in the code change is to delete the
seek() methods. They are replaced by the new methods
narrow_seek(). Before we get to those methods, let me present the new methods to sweep in both directions:
private boolean sweepClockwise(int ...