Left Turns
Does the same waitUntil Command block work for left turns?
Hint: To turn left, the right motor (motorB) should spin forward (positive power),
and left motor (motorC) should spin backward (negative power).
Make these changes to the part of your program as shown below.
The same block works for both left and right turns, because the Wait Block is set to wait for any 90-degree change in the Gyro Sensor's reading. A 90-degree turn causes a 90-degree CHANGE in direction, regardless of whether the turn is to the left or right. |
Mini Challenge: Square Box
Using Gyro Sensor, you can program your robot to make more accurate turns. This means you can reduce the amount of error even if you make the robot turn multiple times in a single run!Can't remember how to control the LED's? Review it again from Page 3 of the Moving Forward chapter.
The value 0 on the Gyro Sensor is always in reference to its original direction. If the first turn leaves the robot facing "90" degrees, what will a second 90 degree turn need to turn to?
The second turn will need to turn until the Gyro Sensor reads 180 degrees (90+90). What about the third and fourth?
The third turn will need to go until the Gyro Sensor reads 270 degrees, and the fourth will need to go until it has reached 360.
Did you know?
How the Gyro Sensor Works
Why can't a programmer just use the turnLeft and turnRight commands with the Gyro Sensor?
|
The EV3 Gyro Sensor is a MEMS Sensor (Micro-ElectroMechanical System)