-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLightStripSubsystem.java
More file actions
33 lines (25 loc) · 1.05 KB
/
LightStripSubsystem.java
File metadata and controls
33 lines (25 loc) · 1.05 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
package frc.robot.subsystems;
import edu.wpi.first.wpilibj.motorcontrol.Spark;
import edu.wpi.first.wpilibj2.command.SubsystemBase;
import frc.robot.commands.lightStrip.SetLed;
import frc.robot.constants.Constants;
import frc.robot.constants.enums.ShootingState;
import frc.robot.subsystems.swervedrive.SwerveSubsystem;
import frc.robot.utils.BlinkinPattern;
import java.util.function.BooleanSupplier;
public class LightStripSubsystem extends SubsystemBase{
public static final String LOGGING_NAME = "LightStripSubsystem";
private final Spark io;
private BlinkinPattern pattern;
public LightStripSubsystem(SwerveSubsystem drivebase, ShootingState shootingState, BooleanSupplier stalledIntake) {
this.io = new Spark(Constants.LIGHT_STRIP_CHANNEL);
setDefaultCommand(new SetLed(this, drivebase, shootingState, stalledIntake));
}
public void setPattern(BlinkinPattern pattern) {
this.pattern = pattern;
io.set(this.pattern.getPwm());
}
public BlinkinPattern getPattern() {
return pattern;
}
}