Skip to content

Commit

Permalink
Format document
Browse files Browse the repository at this point in the history
  • Loading branch information
AceiusRedshift committed Feb 27, 2024
1 parent 14a162f commit 2717dff
Showing 1 changed file with 16 additions and 22 deletions.
38 changes: 16 additions & 22 deletions src/main/java/frc/robot/commands/LED.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,35 @@
import edu.wpi.first.wpilibj.AddressableLEDBuffer;
import edu.wpi.first.wpilibj2.command.Command;

public class LED extends Command{
public class LED extends Command {

private AddressableLED m_led;
private AddressableLEDBuffer m_ledBuffer;
private int h = 0;
private int s = 0;
private int v = 0;

private void setColor(int h, int s, int v) {
for (int i = 0; i < m_ledBuffer.getLength(); i++) {
m_ledBuffer.setHSV(i, h, s, v);
}
}

public LED(AddressableLED m_led, AddressableLEDBuffer m_ledBuffer, int h, int s, int v) {
this.m_led = m_led;
this.m_ledBuffer = m_ledBuffer;
this.h = h;
this.s = s;
this.v = v;
}

@Override
public void initialize() {

// 9 is the PWM port
// m_led = new AddressableLED(9);

// Default length of 60 starting with empty output
// m_ledBuffer = new AddressableLEDBuffer(60);

m_led.setLength(m_ledBuffer.getLength());

// seting the data
Expand All @@ -30,23 +43,4 @@ public void initialize() {

m_led.setData(m_ledBuffer);
}

public void setColor(int h, int s, int v) {
for (int i = 0; i < m_ledBuffer.getLength(); i++) {
m_ledBuffer.setHSV(i, h, s, v);
}
}

public LED(AddressableLED m_led, AddressableLEDBuffer m_ledBuffer, int h, int s, int v) {

this.m_led = m_led;
this.m_ledBuffer = m_ledBuffer;
this.h = h;
this.s = s;
this.v = v;

}



}

0 comments on commit 2717dff

Please sign in to comment.