Activity 3 Basic Outputs Programming (vex) Introduction


Part 2: Controlling one motor



Download 1.07 Mb.
Page3/3
Date28.05.2018
Size1.07 Mb.
#51403
1   2   3
Part 2: Controlling one motor

  1. Open the PLTW ROBOTC template. Click File, Save As, select the folder that your teacher designated, and then name the file A1_2_3_Part2. Setup the motors and sensors as done previously.

  2. The wiring configuration and motors and sensors tabs should be the same as above.

  3. Write a program that performs the following simple behaviors. Use the natural language functions where appropriate as shown below. Add comments at the end of each command line to explain the purpose of each step.

    1. Turn the rightMotor on forward at half speed for 5 seconds.

    2. Stop the motor.








Natural Language PLTW – Movement




Natural Language PLTW – Special

















Natural Language PLTW – Until




Natural Language PLTW – Wait





Motor



  1. Test the program and troubleshoot if needed until the expected behavior has occurred.

  2. Modify the program above to include this simple behavior.

Turn on leftMotor at the same time that rightMotor is turned on.

  1. Test the program and troubleshoot if needed until the expected behavior has occurred.

  2. Modify the program above to include this simple behavior.

Reverse both motors using two different programming methods.

  1. Test the program and troubleshoot if needed until the expected behavior has occurred. Save the program.

Part 3: Controlling two motors

  1. Open the PLTW ROBOTC template. Click File, Save As, select the folder that your teacher designated, and then name the file A1_2_3_Part3. Setup the motors and sensors as done previously.

  2. Write a program that performs the following simple behaviors. Use the natural language functions where appropriate as shown below. Add comments at the end of each command line to explain the purpose of each step.

    1. Turn the rightMotor on forward at half speed for 5 seconds, and then stop.

    2. Turn the leftMotor on in reverse at three-fourths speed for 2.5 seconds, and then stop.

    3. Turn both motors on at full power while spinning in the same direction for 7.25 seconds, and then stop.

  3. Test the program and troubleshoot if needed until the expected behavior has occurred. Save the program.

Part 4: Controlling a servomotor

  1. Team A will open the PLTW ROBOTC template. Click File, Save As, select the folder that your teacher designated, and then name the file A1_2_3_Part4. Setup the motors and sensors as done previously.

  2. Use the program below in the task main() section of the program between the curly braces.

setServo(servoMotor, -127);

wait(2);


setServo(servoMotor, 0);

wait(2);


setServo(servoMotor, 127);

wait(2);






Servo Motor



  1. Power on the Cortex and compile and download the program. If you have any errors, check with your instructor to troubleshoot your program. Save the program.

  2. Document what this program would look like as pseudocode simple behaviors.

  3. Write a program that performs the following simple behaviors. Use the natural language functions where appropriate as shown below. Add comments at the end of each command line to explain the purpose of each step.

    1. Program the servo to go to position -127 for 2 seconds.

    2. Go to position -63 for 3 seconds.

    3. Go to position 0 for 2 seconds.

    4. Go position 63 for 3 seconds.

    5. Go to position 127 for 2 seconds.

  4. Test the program and troubleshoot if needed until the expected behavior has occurred. Save the program.

  5. Team A will exchange testbeds with team B. Team B will complete the previous steps.

  6. Follow teacher direction and either print the programs or submit electronically with this activity.

Conclusion

  1. Describe any challenges that you encountered while developing the program.

  2. Describe how these outputs might be used in an application.

© 2013 Project Lead The Way, Inc.

Computer Integrated Manufacturing Activity 1.2.3 Basic Outputs Programming (VEX) – Page




Download 1.07 Mb.

Share with your friends:
1   2   3




The database is protected by copyright ©ininet.org 2024
send message

    Main page