diff --git a/src/main/java/org/murraybridgebunyips/bunyipslib/subsystems/BlinkinLights.java b/src/main/java/org/murraybridgebunyips/bunyipslib/subsystems/BlinkinLights.java new file mode 100644 index 000000000..7fa2e8f03 --- /dev/null +++ b/src/main/java/org/murraybridgebunyips/bunyipslib/subsystems/BlinkinLights.java @@ -0,0 +1,61 @@ +package org.murraybridgebunyips.bunyipslib.subsystems; + +import com.qualcomm.hardware.rev.RevBlinkinLedDriver; + +import org.murraybridgebunyips.bunyipslib.BunyipsSubsystem; +import org.murraybridgebunyips.bunyipslib.external.units.Measure; +import org.murraybridgebunyips.bunyipslib.external.units.Time; +import org.murraybridgebunyips.bunyipslib.tasks.RunForTask; +import org.murraybridgebunyips.bunyipslib.tasks.bases.Task; + +public class BlinkinLights extends BunyipsSubsystem { + private final RevBlinkinLedDriver lights; + private final RevBlinkinLedDriver.BlinkinPattern defaultPattern; + private RevBlinkinLedDriver.BlinkinPattern currentPattern; + + public BlinkinLights(RevBlinkinLedDriver light, RevBlinkinLedDriver.BlinkinPattern defaultBlinkPattern) { + lights = light; + defaultPattern = defaultBlinkPattern; + currentPattern = defaultBlinkPattern; + + lights.setPattern(defaultPattern); + } + + public void setPattern(RevBlinkinLedDriver.BlinkinPattern pattern) { + currentPattern = pattern; + } + + public Task setPatternForTask(Measure