-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path973A 2017.c
48 lines (41 loc) · 1.59 KB
/
973A 2017.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
#pragma config(Motor, port1, backRight, tmotorVex393_HBridge, openLoop)
#pragma config(Motor, port2, midRight1, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port3, midRIght2, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port4, frontRight, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port5, backLeft, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port6, midLeft1, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port7, midLeft2, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port8, frontLeft, tmotorVex393_MC29, openLoop)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
#pragma platform(VEX2)
#pragma competitionControl(Competition)
#pragma autonomousDuration(20)
#pragma userControlDuration(120)
#define yAxis -vexRT[Ch3]
#define rAxis vexRT[Ch1]
//Main competition background code...do not modify!
#include "Vex_Competition_Includes.c"
void arcadeDrive(int yValue, int rValue){
motor[frontLeft] = + yValue - rValue;
motor[midLeft2] = + yValue - rValue;
motor[backLeft] = + yValue - rValue;
motor[midLeft1] = + yValue - rValue;
motor[frontRight] = + yValue + rValue;
motor[midRIght2] = + yValue + rValue;
motor[midRight1] = + yValue + rValue;
motor[backRight] = + yValue + rValue;
}
void pre_auton()
{
bStopTasksBetweenModes = true;
}
task autonomous()
{
arcadeDrive(127,0);
wait1Msec(2000);
}
task usercontrol(){
while (true) {
arcadeDrive(yAxis,rAxis);
}
}