You think the answers you have put into the exam booklet are correct you put the pencil down and prepare for a well-deserved break. Now you have a few minutes to spare, so you go back and look at your answers. You tackle each problem, writing code and more code, and complete the four problems. You paced yourself through the multiple-choice questions and now you are pushing through the second half of the exam, the free-response section. You have been learning and preparing for an intense three hours of computer science testing for the past few months. In this case, the motor is stopped since the time has run out.It is a nice sunny day in May. The End() method is called when the command is finished and is a place to clean up. This command is finished when the limit switch in the Claw subsystem is tripped. Start the claw motor moving in the closing direction by calling the Close() method that was added to the Claw subsystem in the CloseClaw Initialize method. The lines of code that are shown in the boxes are added to add this behavior. The commands responsibility is to run the motor for the correct time. The Claw subsystem has methods to start the motor running in the right direction and to stop it. To operate this very simple claw mechanism the motor needs to operate in the close direction. The command represents the behavior of the claw, that is the operation over time. RobotBuilder will generate the class files for the CloseClaw command. 12 13 package 14 import 2.command.CommandBase 15 16 // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=IMPORTS 17 import 18 19 // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=IMPORTS 20 21 /** 22 * 23 */ 24 public class CloseClaw extends CommandBase Driving the Robot with Tank Drive and Joysticksġ1 // ROBOTBUILDER TYPE: Command.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |