Class LEDs

All Implemented Interfaces:
Sendable, Subsystem

public class LEDs extends SubsystemBase
This is the class header for the LEDs Subsystem
  • Constructor Details

    • LEDs

      public LEDs(int length, int port)
      constructs a LED Subsystem
      Parameters:
      length - length of the addressable LEDS
      port - port ID for PWM
  • Method Details

    • getLength

      public int getLength()
      Get LED strip length
      Returns:
      number of LEDs
    • setHSV

      public void setHSV(int index, int h, int s, int v)
      Set individual LED color via HSV
      Parameters:
      index - the LED index to set
      h - the h value [0-180)
      s - the s value [0-255]
      v - the v value [0-255]
    • setData

      public void setData()
      Sets the LED output data.
    • setRGB

      public void setRGB(int index, int r, int g, int b)
      Set individual LED color via RGB
      Parameters:
      index - the LED index to set
      r - the r value [0-255]
      g - the g value [0-255]
      b - the b value [0-255]
    • setRGB

      public void setRGB(int r, int g, int b)
      Sets RGB Color of the entire LED strip
      Parameters:
      r - - [0 - 255]
      g - - [0 - 255]
      b - - [0 - 255]
    • setColor

      public void setColor(int index, Color color)
      Set individual LED color via Color
      Parameters:
      index - the LED index to set
      color - The color of the LED
    • setColor

      public void setColor(Color color)
      Sets the Color of the entire LED strip
      Parameters:
      color - color set for the LEDs
    • getColor

      public Color getColor(int index)