-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPrototype Code v0.01.c
101 lines (81 loc) · 4.8 KB
/
Prototype Code v0.01.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#pragma config(Sensor, in1, clawPot, sensorPotentiometer)
#pragma config(Sensor, dgtl1, encoderLeft, sensorQuadEncoder)
#pragma config(Sensor, dgtl3, encoderRight, sensorQuadEncoder)
#pragma config(Sensor, dgtl5, encoderLift, sensorQuadEncoder)
#pragma config(Sensor, dgtl7, limitLift, sensorTouch)
#pragma config(Motor, port2, driveLeft1, tmotorVex393HighSpeed_MC29, openLoop, driveLeft)
#pragma config(Motor, port3, driveRight1, tmotorVex393HighSpeed_MC29, openLoop, reversed, driveRight)
#pragma config(Motor, port4, liftLeft, tmotorVex393_MC29, openLoop, reversed)
#pragma config(Motor, port5, liftRight, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port6, chainBarLeft, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port7, chainBarRight, tmotorVex393_MC29, openLoop, reversed)
#pragma config(Motor, port8, clawMotor, tmotorVex393_MC29, openLoop, reversed)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
/*---------------------------------------------------------------------------*/
/* */
/* Description: Competition template for VEX EDR */
/* */
/*---------------------------------------------------------------------------*/
// This code is for the VEX cortex platform
#pragma platform(VEX2)
// Select Download method as "competition"
#pragma competitionControl(Competition)
//Main competition background code...do not modify!
#include "Vex_Competition_Includes.c"
#include "BasicFunctions_v0.1.c"
#include "ComplexFunctions_v0.1.c"
#include "Autonomous_v0.1.c"
#include "AuxTasks_v0.1.c"
/*---------------------------------------------------------------------------*/
/* Pre-Autonomous Functions */
/* */
/* You may want to perform some actions before the competition starts. */
/* Do them in the following function. You must return from this function */
/* or the autonomous and usercontrol tasks will not be started. This */
/* function is only called once after the cortex has been powered on and */
/* not every time that the robot is disabled. */
/*---------------------------------------------------------------------------*/
void pre_auton()
{
// Set bStopTasksBetweenModes to false if you want to keep user created tasks
// running between Autonomous and Driver controlled modes. You will need to
// manage all user created tasks if set to false.
bStopTasksBetweenModes = true;
// Set bDisplayCompetitionStatusOnLcd to false if you don't want the LCD
// used by the competition include file, for example, you might want
// to display your team name on the LCD in this function.
// bDisplayCompetitionStatusOnLcd = false;
// 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()
{
autoMain();
}
/*---------------------------------------------------------------------------*/
/* */
/* 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()
{
startTask(driveControl);
while (true) {
chainBarControl();
liftControl();
clawControl();
}
}