Presentation is loading. Please wait.

Presentation is loading. Please wait.

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.

Similar presentations


Presentation on theme: "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."— Presentation transcript:

1 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) Open the BMS PLTW template file in Canvas and save your W: drive with these steps: a)In Canvas, open the Testbed Coding assignment. b)Left click on the BMS PLTW template link. c)Right click on the BMS PLTW template link and Save link as… Save it to your W: drive. d)Use this file whenever you start a new Program. Be sure your don’t save over this link, otherwise you’ll need to perform steps a-c again. 2) The software we’re using is ROBOTC for VEX Robotics 4.x. Open it now from the Start menu or Desktop and open the file from your W: drive from step 1. Save this template file with a different name (Testbed 1, Testbed 2, etc.) to your W: drive. 3) 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

2 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.

3 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.

4 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 file from your W: drive. 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.

5 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 file from your W: drive. 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.

6 Testbed 3 Before writing your own program based on the Task Description below, open and run the program above. To do this you’ll use the same steps as #1 and #2 from the first page of this PowerPoint except you’ll use the program called Wait for Dark 5. Also, be sure to read the full Task Description above and its Notes. 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) 2000. Note: you will need to use the same white paper method above.


Download ppt "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."

Similar presentations


Ads by Google