-
Notifications
You must be signed in to change notification settings - Fork 0
/
general.c
42 lines (40 loc) · 1.06 KB
/
general.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
#pragma systemFile
bool hasInit = false;
void init() {
if(!hasInit) {
SmartMotorsInit();
//SmartMotorsAddPowerExtender(liftLB, liftLC, liftRB, liftRC);
//SmartMotorSetPowerExpanderStatusPort(powerExpander);
SmartMotorLinkMotors(driveLF, driveLB);
SmartMotorLinkMotors(driveRF, driveRB);
SmartMotorLinkMotors(liftLA, liftLB);
SmartMotorLinkMotors(liftLA, liftLC);
SmartMotorLinkMotors(liftRA, liftRB);
SmartMotorLinkMotors(liftRA, liftRC);
//SmartMotorCurrentMonitorEnable();
SmartMotorsSetEncoderGearing(liftLA, 0.04);
SmartMotorsSetEncoderGearing(liftLB, 0.04);
SmartMotorsSetEncoderGearing(liftLC, 0.04);
SmartMotorsSetEncoderGearing(liftRA, 0.04);
SmartMotorsSetEncoderGearing(liftRB, 0.04);
SmartMotorsSetEncoderGearing(liftRC, 0.04);
SmartMotorRun();
startLiftPID(2.8);
hasInit = true;
startTask(solenoidControl);
}
}
void userControl(bool isArcade, bool isArmPID) {
stopTask(drivePID);
if(isArcade) {
arcade();
} else {
tank();
}
if(isArmPID) {
userControlArmPID();
} else {
stopTask(liftPID);
userControlArmNoPID();
}
}