-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBenMCode.c
47 lines (40 loc) · 1.24 KB
/
BenMCode.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
#pragma config(Motor, port3, leftwheel, tmotorServoContinuousRotation, openLoop, reversed)
#pragma config(Motor, port4, rightwheel, tmotorServoContinuousRotation, openLoop, reversed)
#pragma config(Motor, port6, test1, tmotorServoContinuousRotation, openLoop)
#pragma config(Motor, port7, test2, tmotorServoContinuousRotation, openLoop)
#pragma config(Motor, port8, base, tmotorServoStandard, openLoop)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
task main(){
while(true){
motor[port7] = vexRT[Ch2];
motor[port6] = vexRT[Ch3] / 2;
if(vexRT[Btn5D]){
motor[port4] = -127;
} else if (vexRT[Btn5U]) {
motor[port4] = 127;
} else if(vexRT[Btn7U]){
motor[port4] = -50;
} else if (vexRT[Btn7D]) {
motor[port4] = 50;
} else {
motor[port4] = 0;
}
if(vexRT[Btn6D]){
motor[port3] = -127;
} else if (vexRT[Btn6U]) {
motor[port3] = 127;
} else if(vexRT[Btn8U]){
motor[port3] = -50;
} else if (vexRT[Btn8D]) {
motor[port3] = 50;
} else {
motor[port3] = 0;
}
if(vexRT[Btn8R]){
motor[port8] = 127;
}
if(vexRT[Btn7L]){
motor[port8] = -127;
}
}
}