Steering left and right

We must also make MyBlocks for steering the wheels left and right. We cannot directly borrow these from the previous project; while the steering MyBlocks we made for the Falcon project are very precise, we cannot use them because the navigation program starts to become too complex for them to work. Instead, we will opt for a simpler alternative: a simple switch block that checks the current position of the steering motor. If the motor is less than 45 degrees from the center, the program rotates the motor 45 degrees. Here is the simplified steerLeft MyBlock:

And here is the simple steerRight MyBlock, which is a mirror ...

Get Building Smart LEGO MINDSTORMS EV3 Robots now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.