Controlling the driving

We have set up the heading and proximity values with their respective k values. We can now use these values to control the driving of the tank.

Add a move steering block after the second math block that you just placed. By default, it will be set to control the drive motors in port B + C; this is correct, so we will not change the port assignment. We will need to change the mode of the motor block to On.

Drag a data wire from result, the output of the first math block (the one with the value of k1) and plug it into the steering input of the move steering block. Plug the result of the second math block into the power input of the move steering block.

Now, the heading and proximity values measured by IR 1 can adjust ...

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.