Programming the robot to move forward

Before we program our robot, we need to attach the cables. Plug in cables from the motors into ports B and C on the EV3 intelligent brick.

Let's write a simple program to test out our robots. Drag a Move Steering block onto the Programming Canvas and place it next to the Start block, as shown in the following screenshot:

Programming the robot to move forward

Using the drop-down menu, set the Move Steering block to On for Rotations. Set the number of rotations of the wheels to 5 as shown in the following screenshot. Remember that the motors have built-in shaft encoders that can tell how far they have rotated. The direction can be set to zero, which ...

Get Learning LEGO MINDSTORMS EV3 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.