-
Notifications
You must be signed in to change notification settings - Fork 1
/
Team 3 RC
70 lines (62 loc) · 1.62 KB
/
Team 3 RC
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
#pragma config(Motor, port1, leftFront, tmotorVex393_HBridge, openLoop)
#pragma config(Motor, port2, leftBack, tmotorVex393_MC29, openLoop, reversed)
#pragma config(Motor, port3, rightFront, tmotorVex393_MC29, openLoop, reversed)
#pragma config(Motor, port4, rightBack, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port5, barLift1, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port6, barLift2, tmotorVex393_MC29, openLoop, reversed)
#pragma config(Motor, port7, Goliath, tmotorVex393_MC29, openLoop)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
task main()
{
short leftSpeed;
short rightSpeed;
short barSpeed;
short goliathSpeed;
while(true)
{
/*
DRIVE CONTROL
*/
//Controls left drive
if (vexRT[Ch2] > -35 && vexRT[Ch2] < 35){
leftSpeed = 0;
}
else {
leftSpeed = vexRT[Ch3];
}
//Controls right drive
if (vexRT[Ch3] > -35 && vexRT[Ch3] < 35){
rightSpeed = 0;
}
else {
rightSpeed = vexRT[Ch2];
}
//Controls Bar lift
if (vexRT[Btn6U] == 1){
barSpeed = 80;
}
else if (vexRT[Btn6D] == 1){
barSpeed = -80;
}
else {
barSpeed = 0;
}
//Controls Goliath
if (vexRT[Btn5U] == 1){
goliathSpeed = 127;
}
else if (vexRT[Btn5D] == 1){
goliathSpeed = -127;
}
else {
motor[Goliath] = 0;
}
}
motor[leftFront] = leftSpeed;
motor[leftBack] = leftSpeed;
motor[rightFront] = rightSpeed;
motor[rightBack] = rightSpeed;
motor[barLift1] = barSpeed;
motor[barLift2] = barSpeed;
motor[Goliath] = goliathSpeed;
}