-
Notifications
You must be signed in to change notification settings - Fork 1
/
CombinedReplay.h
61 lines (56 loc) · 1.45 KB
/
CombinedReplay.h
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
//Deadband (UNUSED)
#define deadbandDrive(x) (fabs( x )>10)?( x ):0
//Constants
const int rackPowerUp = -64;
const int rackPowerDown = 64;
//const int clawPowerOpen = 64;
//const int clawPowerClosed = -30;
//const int leftLiftPowerUp = 64;
//const int leftLiftPowerDown = -32;
//const int rightLiftPowerUp = 64;
//const int rightLiftPowerDown = -32;
task combinedReplay(){
//writeDebugStreamLine("(%s,%d): Entering combinedReplay task ",__FILE__,__LINE__);
while(true){
motor[port3] = bch3 + bch4;
motor[port4] = bch3 + bch4;
motor[port7] = -1*(bch3 - bch4);
motor[port8] = -1*(bch3 - bch4);
if(b6u){
motor[port2] = -1 * rackPowerUp;
motor[port9] = rackPowerUp;
}else if(b6d){
motor[port2] = -1 * rackPowerDown;
motor[port9] = rackPowerDown;
}else{
motor[port2] = 0;
motor[port9] = 0;
}
/*
if(b6u){
motor[port8] = clawPowerOpen;
}else if(b6d){
motor[port8] = clawPowerClosed;
}else{
motor[port8] = 0;
}
if(b5u){
motor[port4] = -1 * leftLiftPowerUp;
motor[port5] = -1 * leftLiftPowerUp;
motor[port6] = rightLiftPowerUp;
motor[port7] = rightLiftPowerUp;
}else if(b5d){
motor[port4] = -1 * leftLiftPowerDown;
motor[port5] = -1 * leftLiftPowerDown;
motor[port6] = rightLiftPowerDown;
motor[port7] = rightLiftPowerDown;
}else{
motor[port4] = 0;
motor[port5] = 0;
motor[port6] = 0;
motor[port7] = 0;
}
*/
sleep(25);
}
}