Now that we know how to make the robot move forward let's see we can make it move backward.
- 03 Mar 2017
Setting power to minus
To make the motors move backward we set the motor power to a minus number
motor[port2] = -50
motor[port3] = -50
Now that we know how to make the robot move forward, let's see how we can make it move backward.
There's actually only one small modification that we must do in the program and for the motor on port 2 we must set a power of -50. And this means in reverse direction. And for motor on port 3 again -50. So, actually the range at which we can set is between -128 to 127. But we should check this. Let's see how the robot behaves. Running the program.
What's forward and backward for this robot is something that you choose depending on how you construct the motors and which motor is in reverse. That's something you choose. But now let's see how the robot moves backward with our program.
Курсове и занятия включващи този Урок
Този Урок е използван в следните курсове и занятия.