Programming and theory Pro Preview

In the next lessons we will recall how to follow a line and you will learn some new ways of following a line. But today we will start with a new block which will help us along the process.

To access the full video please subscribe to FLLCasts.com

Subscribe

  • #762
  • 09 Mar 2018

Let’s first recall how to follow a line. The robot should turn to one direction until it detects black and then to the opposite direction until it detects white. In this case, you should constantly rotate the large motor and, depending on the color, you should rotate the medium motor to one or the other direction, as in the program below:

When the robot is on White, rotate the motor 30 degrees, and when on Black – -30 degrees. The problem is that you should rotate the motor a different amount of degrees depending on the situation, as in the table below:

When the sensor detects white, the motor will rotate either 0, 30 or 60 degrees. To calculate the degrees of the rotation, you should know the current location of the motor. You can use the following block to do that:

This block measures the degrees to which the motor is currently rotated. To display this information on the screen, you should develop the following program: