Testbed Coding In this activity you will code different challenges for the Testbed. For each challenge a sample program is shown. Use what this sample program shows you to write your own similar program. Show your teacher when you’ve successfully written each program. 1) The software we’re using is ROBOTC for VEX Robotics 4.x. Open it now from the Start menu or Desktop. 2) After the software opens, be sure that the following settings are correct (you may only have to do this the first time you use the software at a particular computer): a) Robot>Platform Type>Natural Language PLTW b) Robot>Platform Type>VEX 2.0 Cortex c) Robot>VEX Cortex Communication Mode>USB Only 3) Open our BMS PLTW template through the software from the T: drive: File>Open Sample Program>T:\Middle School\Melville\Student Technology Files\Vex
A Typical Program Be sure to fill in all parts shown (Project Title, Team Members, etc.). Everything in green is for you and other viewers only- the software does not read this. This is know as pseudocode. (pronounced sue-doh-code). Pseudocode helps people to understand the purpose of the program. Everything in blue and red between the red curly braces is code- this is the language of the software (ROBOTC) and this is exactly what the software will tell the robot to do. Use the drag and drop method to place the appropriate command (startMotor, wait, etc.) from the left side of the screen to the proper location.
When you’re ready to test your program: 1) Save it to your W: drive with a good name (i.e. Testbed 1). 2) Plug the orange USB cord in the Testbed Cortex and into the computer. You may need to wait while an update occurs. 3) Turn on the Cortex. 4) Tell the software where all the robot sensors, motors, and LEDs are plugged in: Robot>Motors and Sensors Setup> Standard Models>pull down to GTT Testbed>Apply>OK 5) Click on “Compile Program”. If there are no errors (yellow or red X’s) then your program is ready to run. 6) Click on “Download to Robot” and, once it’s ready, click “Start” to see if it works the way you intended.
Testbed 1 Use what this sample program is teaching you to write your own similar program. Be sure to start with a new BMS PLTW template program from the T: drive (see step 5 on first page). Note: Full motor speed is 127. Motors speeds must be whole numbers so round to the nearest whole number, if needed. Show Mr. Melville the program and the working Testbed when complete: Task Description: Turn the left motor counterclockwise at ½ speed for 3 seconds, wait a second, turn the right motor on counterclockwise at ½ speed for 3 seconds, wait a second, and turn both motors in opposite directions for 5 seconds.
Testbed 2 Use what this sample program is teaching you to write your own similar program. Be sure to start with a new BMS PLTW template program from the T: drive (see step 5 on first page). Note: The blank lines in the code are to help show the 4 distinct parts of the program. Show Mr. Melville the program and the working Testbed when complete: Task Description: When the limit switch is pressed both motors will turn at ½ speed in opposite directions and the green LED will turn on. When the bumper switch is pressed and released the left motor will stop and the green LED will turn off. When the bumper switch is pressed and released again the right motor will turn off.
Testbed 3 Run the sample program above, saved here: T:\Middle School\Melville\Student Technology Files\Vex\testbed 3 sample program. Then, take what the program taught you to right your own similar program. Be sure to start with a new BMS PLTW template program from the T: drive (see step 5 on first page). Show Mr. Melville the program and the working Testbed when complete: Task Description: Wait until the bumper switch is pressed and released, turn the motors on in opposite directions at full speed, wait until the line follower reads a level higher than (darker than) 2000, stop both motors, restart both motors at ½ speed in opposite directions for 2 seconds, speed up both motors to full speed, and stop them both once the line follower reads a level higher than (darker than) Note: you will need to use the same white paper method above.