forked from mattxwang/RobotC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Competition-2016-02-27.c
executable file
·65 lines (52 loc) · 2.42 KB
/
Competition-2016-02-27.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
#pragma config(Motor, port2, frontRightMotor, tmotorNormal, openLoop, reversed)
#pragma config(Motor, port3, backRightMotor, tmotorNormal, openLoop, reversed)
#pragma config(Motor, port4, frontLeftMotor, tmotorNormal, openLoop, reversed)
#pragma config(Motor, port5, backLeftMotor, tmotorNormal, openLoop)
#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!
/////////////////////////////////////////////////////////////////////////////////////////
//
// Pre-Autonomous Functions
//
// INITALIZE FUNCTIONS FOR AUTONOMOUS pre_auton FUNCTION HERE
//
/////////////////////////////////////////////////////////////////////////////////////////
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
// Such as resetting motor encoder values, setting motors to specific 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()
{
// .....................................................................................
// Insert user code here.
// .....................................................................................
//AutonomousCodePlaceholderForTesting(); // Remove this function call once you have "real" code.
}
task usercontrol()
{
// User control code here, inside the loop
while (true) //While 1 == 1 would also work here. Just saying.
{
//Possible the simplest "Tank Controls" code
motor[frontRightMotor] = vexRT[Ch2];
motor[backRightMotor] = vexRT[Ch2];
motor[frontLeftMotor] = vexRT[Ch3];
motor[backLeftMotor] = vexRT[Ch3];
}
}