Class RevBlinken

  • All Implemented Interfaces:
    edu.wpi.first.wpilibj.PIDOutput, edu.wpi.first.wpilibj.Sendable, edu.wpi.first.wpilibj.SpeedController, AutoCloseable

    public class RevBlinken
    extends edu.wpi.first.wpilibj.Spark
    Wrapper class for controlling a REV Blinken LED controller. This class is a wrapper around a Spark instance for sending the actual PWM signals, but provides a way to set the PWM setpoint by specifying the displayed color pattern (passing a ColorPattern) instead of the raw PWM output.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  RevBlinken.ColorPattern
      Enum for possible color patterns according to the Blinken user manual.
      • Nested classes/interfaces inherited from class edu.wpi.first.wpilibj.PWM

        edu.wpi.first.wpilibj.PWM.PeriodMultiplier
    • Constructor Summary

      Constructors 
      Constructor Description
      RevBlinken​(int channel)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void set​(double manualSetpoint)
      Sets the Blinken output manually.
      void set​(@NotNull RevBlinken.ColorPattern pattern)
      Sets the light pattern.
      • Methods inherited from class edu.wpi.first.wpilibj.Spark

        initSpark
      • Methods inherited from class edu.wpi.first.wpilibj.PWMSpeedController

        disable, get, getDescription, getInverted, initSendable, pidWrite, setInverted
      • Methods inherited from class edu.wpi.first.wpilibj.PWM

        close, enableDeadbandElimination, getChannel, getPosition, getRaw, getRawBounds, getSpeed, setBounds, setDisabled, setPeriodMultiplier, setPosition, setRaw, setSpeed, setZeroLatch, stopMotor
      • Methods inherited from class edu.wpi.first.wpilibj.MotorSafety

        check, checkMotors, feed, getExpiration, isAlive, isSafetyEnabled, setExpiration, setSafetyEnabled
      • Methods inherited from interface edu.wpi.first.wpilibj.Sendable

        addChild, getName, getSubsystem, setName, setName, setName, setName, setSubsystem
      • Methods inherited from interface edu.wpi.first.wpilibj.SpeedController

        setVoltage, stopMotor
    • Constructor Detail

      • RevBlinken

        public RevBlinken​(int channel)
        Constructor.
        Parameters:
        channel - The PWM channel that the Blinken is attached to. 0-9 are on-board, 10-19 are on the MXP port
        Throws:
        IndexOutOfBoundsException - If the specified PWM channel does not exist.
    • Method Detail

      • set

        public void set​(double manualSetpoint)
        Sets the Blinken output manually.
        Specified by:
        set in interface edu.wpi.first.wpilibj.SpeedController
        Overrides:
        set in class edu.wpi.first.wpilibj.PWMSpeedController
        Parameters:
        manualSetpoint - The manual setpoint to be sent over PWM.