Package frc.robot.subsystems
Class LEDs
java.lang.Object
edu.wpi.first.wpilibj2.command.SubsystemBase
frc.robot.subsystems.LEDs
This is the class header for the LEDs Subsystem
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetColor
(int index) int
Get LED strip lengthvoid
Set individual LED color via Colorvoid
Sets the Color of the entire LED stripvoid
setData()
Sets the LED output data.void
setHSV
(int index, int h, int s, int v) Set individual LED color via HSVvoid
setRGB
(int r, int g, int b) Sets RGB Color of the entire LED stripvoid
setRGB
(int index, int r, int g, int b) Set individual LED color via RGBMethods inherited from class edu.wpi.first.wpilibj2.command.SubsystemBase
addChild, getName, getSubsystem, initSendable, setName, setSubsystem
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface edu.wpi.first.wpilibj2.command.Subsystem
defer, getCurrentCommand, getDefaultCommand, periodic, register, removeDefaultCommand, run, runEnd, runOnce, setDefaultCommand, simulationPeriodic, startEnd, startRun
-
Constructor Details
-
LEDs
public LEDs(int length, int port) constructs a LED Subsystem- Parameters:
length
- length of the addressable LEDSport
- 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 seth
- 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 setr
- 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
Set individual LED color via Color- Parameters:
index
- the LED index to setcolor
- The color of the LED
-
setColor
Sets the Color of the entire LED strip- Parameters:
color
- color set for the LEDs
-
getColor
-