This means that if you need a Gyro sensor to be reset to 0, so the autonomous turns to the correct degree, this is where you do it! Autonomous: The Pre-Autonomous is the field where you tell the robot what to do, before the competition match starts. DO NOT edit any of these, unless you know EXACTLY what you are doing. Do not try to change these values directly in the code while you are still learning, stay with the graphical Motor Setup!Ĭompetition includes, load all the files and values that the program uses to make it work in a competition. Once you have successfully completed the Motor and Sensor setup, you should now have several lines of new code at the very top of your Competition Template. An example of a completed Motor setup can be found in the gallery above. IMPORTANT NOTE: You may have to reverse a motor, depending on how it is positioned on the robot.Ĥ. In the "Type" drop-down, select what type of motor or sensor you are using. Enter a name for the motor and/or sensor beside the correct port number. You will have many tabs to choose from, to setup the motor ports, navigate to the "Motors" tab, for Analog Sensors, navigate to the "VEX 2.0 Analog Sensors 1-8" tab, etc.ģ. Go to "Robot > Motors and Sensors Setup"Ģ. Essentially, make sure your robot has at least a chassis with motors on it before you start programming!ġ. If you do not setup these motors, it will be a pain to change all of your motor names in your entire code once that is done. The first thing you should do with any RobotC code, is setup your motors and sensors, so that we can begin to program a drive. If these values are changed incorrectly, your program WILL NOT work! Motor and Sensor Setup: IMPORTANT NOTE: When first opening the Competition Template, do not change ANY values, unless you know EXACTLY what you are doing. To open your first competition template, where we will do all of the programming, go to "File > New > Competition Template". Once this has been selected, we are ready to start programming a competition template! Opening your first Competition Template: To do so, go to "Robot > Platform Type > VEX Robotics > VEX 2.0 Cortex". The first thing we need to do, after activating the license, is to make sure that the proper platform is selected. When looping wraps the entire top down method, then the distinction between Event based and Linear becomes a bit fuzzy in my opinion.*Click images to enlarge* Selecting the right platform: As a result, looping may need to be added to the top down method at some level. That is, sensors that were checked earlier in the code may need to be checked again. What tends to happen in Linear mode is that your top down program tends not to be able to do its job by simply running the code once. That is you code your opmode to read sensors and write to motors with the expectation that the action on the motors will performed immediately ( don't have to wait to the end of your opmode method). Linear on the other hand means "top down". The motor actions will go into effect after the loop() method is completes. My interpretation of "Event" based in this context is that the Event is fired ( loop() method is called) when the hardware is ready to be evaluated ( sensors read, motors written to). It implies that it has something do to with traveling in a straight line.I think what they were going for is Linear VS Event based.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |