Gyro sensor movement (Medium)

Using the gyro sensor, the robot will move in a series of motions to follow a square or avoid an obstacle.

Getting ready

The following steps explain how to attach the gyro sensor to our robot:

  1. First, take two axles which are three modules long with stops and attach them to the gyro sensor with bushings as shown in the following figure:
    Getting ready
  2. Next, we will attach the gyro sensor to the two red stop bushings on the back of the robot. We can wire the gyro sensor to Port 4 on our EV3 brick.
    Getting ready

How to do it...

Make the robot go forward, ...

Get Instant LEGO MINDSTORMS EV3 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.