Programming the left side

Now we need to tell the tank what to do if the turret has rotated too far to the left. The programming is going to be very similar to what we did for the right side. As a matter of fact, it is so similar that you may choose to copy the programming for the right side and make the changes from there. Since the left is the negative side, we need to change the sign on all degree and power values and flip the inequality signs.

Navigate to the false case of the most recent switch we added and add yet another switch. This one will be set up just like the last one: set the mode to Motor Rotation | Compare | Degrees, and the port to D. The only difference is we need to flip the inequality and negate the target value. So, ...

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.