-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSetLedFromElevatorPosition.java
More file actions
51 lines (44 loc) · 1.38 KB
/
SetLedFromElevatorPosition.java
File metadata and controls
51 lines (44 loc) · 1.38 KB
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
package frc.robot.commands.lightStrip;
import static frc.robot.constants.ElevatorPosition.LEVEL1;
import edu.wpi.first.wpilibj.DriverStation;
import frc.robot.constants.ElevatorPosition;
import frc.robot.subsystems.lightStrip.LightStrip;
import frc.robot.utils.BlinkinPattern;
import frc.robot.utils.logging.commands.LoggableCommand;
import java.util.function.Supplier;
public class SetLedFromElevatorPosition extends LoggableCommand {
private final Supplier<ElevatorPosition> position;
private final LightStrip lightStrip;
public SetLedFromElevatorPosition(
Supplier<ElevatorPosition> positionSupplier, LightStrip lightStrip) {
this.position = positionSupplier;
this.lightStrip = lightStrip;
addRequirements(lightStrip);
}
@Override
public void execute() {
switch (position.get()) {
case LEVEL1:
lightStrip.setPattern(BlinkinPattern.WHITE);
break;
case LEVEL2:
lightStrip.setPattern(BlinkinPattern.BLUE);
break;
case LEVEL3:
lightStrip.setPattern(BlinkinPattern.HOT_PINK);
break;
case LEVEL4:
lightStrip.setPattern(BlinkinPattern.RAINBOW_RAINBOW_PALETTE);
break;
case CLIMB:
break;
default:
DriverStation.reportWarning("Invalid Reef Position selected", true);
break;
}
}
@Override
public boolean isFinished() {
return false;
}
}