Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma config(Sensor, dgtl1, rightQuad, sensorQuadEncoder)
- #pragma config(Sensor, dgtl3, leftQuad, sensorQuadEncoder)
- #pragma config(Motor, port1, intake1, tmotorVex393_HBridge, openLoop)
- #pragma config(Motor, port2, rightFrontDrive, tmotorVex393_MC29, openLoop, reversed)
- #pragma config(Motor, port3, leftFrontDrive, tmotorVex393_MC29, openLoop)
- #pragma config(Motor, port4, rightBackDrive, tmotorVex393_MC29, openLoop, reversed)
- #pragma config(Motor, port5, leftBackDrive, tmotorVex393_MC29, openLoop)
- #pragma config(Motor, port6, winch1, tmotorVex393_MC29, openLoop)
- #pragma config(Motor, port7, winch2, tmotorVex393_MC29, openLoop)
- #pragma config(Motor, port8, winch3, tmotorVex393_MC29, openLoop)
- #pragma config(Motor, port9, winch4, tmotorVex393_MC29, openLoop)
- #pragma config(Motor, port10, intake2, tmotorVex393_HBridge, openLoop)
- //*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
- #pragma platform(VEX)
- //Competition Control and Duration Settings
- #pragma competitionControl(Competition)
- #pragma autonomousDuration(20)
- #pragma userControlDuration(120)
- #include "Vex_Competition_Includes.c" //Main competition background code...do not modify!
- // Courtesy of Jacob from team 2158S ausTIN CANs - Overclocked.
- //For Jacob of 69.
- /////////////////////////////////////////////////////////////////////////////////////////
- //
- // Pre-Autonomous Functions
- //
- // You may want to perform some actions before the competition starts. Do them in the
- // following function.
- //
- /////////////////////////////////////////////////////////////////////////////////////////
- void pre_auton()
- {
- // Set bStopTasksBetweenModes to false if you want to keep user created tasks running between
- // Autonomous and Tele-Op modes. You will need to manage all user created tasks if set to false.
- bStopTasksBetweenModes = true;
- // All activities that occur before the competition starts
- // Example: clearing encoders, setting servo positions, ...
- }
- /////////////////////////////////////////////////////////////////////////////////////////
- //
- // Autonomous Task
- //
- // This task is used to control your robot during the autonomous phase of a VEX Competition.
- // You must modify the code to add your own robot specific commands here.
- //
- /////////////////////////////////////////////////////////////////////////////////////////
- task autonomous()
- {
- //For auto you just need to figure out how many encoder ticks are in one rotation of your wheel.
- //example
- // .....................................................................................
- // Insert user code here.
- // .....................................................................................
- AutonomousCodePlaceholderForTesting(); // Remove this function call once you have "real" code.
- }
- /////////////////////////////////////////////////////////////////////////////////////////
- //
- // User Control Task
- //
- // This task is used to control your robot during the user control phase of a VEX Competition.
- // You must modify the code to add your own robot specific commands here.
- //
- /////////////////////////////////////////////////////////////////////////////////////////
- task usercontrol()
- {
- // User control code here, inside the loop
- while (true)
- {
- // This is the main execution loop for the user control program. Each time through the loop
- // your program should update motor + servo values based on feedback from the joysticks.
- // .....................................................................................
- // Insert user code here. This is where you use the joystick values to update your motors, etc.
- // .....................................................................................
- motor[rightFrontDrive] = vexRT [Ch2];
- motor[leftFrontDrive] = vexRT [Ch3];
- motor[rightBackDrive] = vexRT [Ch2];
- motor[leftBackDrive] = vexRT [Ch2];
- UserControlCodePlaceholderForTesting(); // Remove this function call once you have "real" code.
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement