To prepare the robot to move in a square and to use a loop in the program we would first make this VEX EDR robot move forward and turn, using a program developed with RobotC.
- #337
- 11 Apr 2017
- 1:29
Move forward
The program for move forward is developed in previous videos. Turn both motors on by setting a power of 50 and use the wait1Msec() call to make the robot wait for about a second.
Turn
To turn with a VEX EDR robot set one of the motor's power to 0 and the other to 50. This will stop the first motor and start the other. Again wait for about a second. The code fragment is:
motor[port2] = 0;
motor[port3] = 50;
wait1Msec(1500);
and it should be enough to make the robot move and turn.
English
First, we'll make the robot move forward and turn. And after that we'll repeat this 4 times. But let's first make it move and turn.
Initially we start with the program for moving forward and after we move forward we must turn. So, I'll copy this code and then I'll change the value. And I would like to turn with motor connected on port 2 and that's why I'll set the right motor to power 0. And then I'll change so that I can have it on the camera recorded. I'll change the waiting here to half a second. 500 milliseconds and here to about 1 second and a half. So, that's the program and in this program we have the code for move forward and this is moving forward and this is turning and this will turn right. And that's the program for moving and turning.
Курсове и занятия включващи този Урок
Този Урок е използван в следните курсове и занятия.
VEX EDR introductory course
Designed to get students started with VEX EDR and RobotC. The robotics set is not very easy to use and offers its challenges. In the course we take a step-by-step approach to moving, turning and using sensors. A big part of the course is about programming and using the RobotC software for the Cortext controller.
This course is still under development and constantly change and extended.
- 43
- 69:49
- 0
Move in a square. What are these things called loops?
In this tutorial we would introduce you to the concept of loops using this VEX EDR Robot. As a final result we would have a program that makes the robot move in a square and not by repeating the same instructions for move and turn four different times.
- 6
- 0
- 0
- 3d_rotation 0