-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathShooter.ino
More file actions
41 lines (35 loc) · 937 Bytes
/
Shooter.ino
File metadata and controls
41 lines (35 loc) · 937 Bytes
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
void fireShirt() {
//do {
//spinBarrel(50);
//} while(-1*barrelEncoder.read() % 160 != 0);
fireSolenoid(solenoidPlunge);
delay(100);
fireSolenoid(solenoidFill);
delay(7500);
retractSolenoid(solenoidFill);
delay(100);
fireSolenoid(solenoidFire);
delay(1000);
retractSolenoid(solenoidFire);
delay(1000);
}
void cancelShot() {
barrelMotor.write(map(0, -255, 255, 0, 180));
retractSolenoid(solenoidPlunge);
retractSolenoid(solenoidFire);
retractSolenoid(solenoidFill);
}
void spinBarrel(double ticks) {
//double target = barrelEncoder.read() + ticks;
//double rate = (target - barrelEncoder.read())/rate * 255 * 0.5;
//barrelMotor.write(map(rate, -255, 255, 0, 180));
}
void raiseLinkage() {
linkageMotor.write(map(30, -255, 255, 0, 180));
}
void lowerLinkage() {
linkageMotor.write(map(-30, -255, 255, 0, 180));
}
void stopLinkage() {
linkageMotor.write(map(0, -255, 255, 0, 180));
}