Challenges‎ > ‎

Test bed 2


Goals:
In this challenge you will learn how both parts of a Competition Project - Autonomous and Operator Control - work together.  In official Vex competitions each round begins with a 20 second autonomous period where your robot can score points while moving on its own.  This is followed immediately by a 2 minute operator control period.

Bronze challenge

Start Easy C for Cortex on your laptop.  Connect the laptop to controller using the orange USB cable. Test your connection by downloading the default code onto the controller (Build and Download > Download easyC default code).

Create a new timed Competition Project (set autonomous time to 20). Write and download a program that turns a motor plugged into port 2 clockwise for five seconds, counter-clockwise for five more seconds, then stops.  Hint:  you will need to click on the Autonomous tab and drag a Motor Module (under Outputs) and a Wait command (under Program Flow) into your program.
 
Download your program onto the Vex controller.  Your program will start running once your joystick links to the controller (either with an orange USB cable or with wireless VEXnet).

Save your program. Name it TeamName_TestBed2_Bronze.  Erase the program from the controller by downloading the default code.

Silver challenge
Create a new timed Competition Project (set autonomous time to 20).  Set up two motors plugged into ports 2 and 3 as shown.  Imagine that wheels and a robot chassis are attached to the motors.  Write and download a program that controls the motors so that your "robot" moves forward for 5 seconds, backwards for five seconds, turns right for five seconds, then stops.

Erase your program by downloading the default code
 
Gold challenge
Modify your program so that the motors keep repeating the forward, backward, right turn from the silver challenge "forever" (actually until the 20 second autonomous period runs out).  Hint:  use a While loop (under Program Flow) You will need a condition that is always true. In C language programs While 1 is often used.