mirror of
https://github.com/Team4388/2022NoWayHome.git
synced 2026-06-09 00:38:05 -06:00
797b8630cd
Remove incorrect licenses
61 lines
1.5 KiB
Java
61 lines
1.5 KiB
Java
package frc4388.robot.subsystems;
|
|
|
|
import java.util.logging.Logger;
|
|
|
|
import edu.wpi.first.wpilibj.motorcontrol.Spark;
|
|
import edu.wpi.first.wpilibj2.command.SubsystemBase;
|
|
import frc4388.robot.Constants.LEDConstants;
|
|
import frc4388.utility.LEDPatterns;
|
|
|
|
/**
|
|
* Allows for the control of a 5v LED Strip using a Rev Robotics Blinkin LED
|
|
* Driver
|
|
*/
|
|
public class LED extends SubsystemBase {
|
|
|
|
private LEDPatterns m_currentPattern;
|
|
// private PWM newLED;
|
|
private Spark m_LEDController;
|
|
|
|
/**
|
|
* Add your docs here.
|
|
*/
|
|
public LED(Spark LEDController){
|
|
m_LEDController = LEDController;
|
|
// this.newLED = newLED;
|
|
setPattern(LEDConstants.DEFAULT_PATTERN);
|
|
updateLED();
|
|
Logger.getLogger(LED.class.getSimpleName()).finer("In the Beginning, there was Joe.\nAnd he said, 'Let there be LEDs.'\nAnd it was good.");
|
|
}
|
|
|
|
@Override
|
|
public void periodic(){
|
|
//SmartDashboard.putNumber("LED", m_currentPattern.getValue());
|
|
}
|
|
|
|
/**
|
|
* Add your docs here.
|
|
*/
|
|
public void updateLED(){
|
|
// newLED.setRaw((int) m_currentPattern.percentToPWM());
|
|
m_LEDController.set(m_currentPattern.getValue());
|
|
}
|
|
|
|
/**
|
|
* Add your docs here.
|
|
*/
|
|
public void setPattern(LEDPatterns pattern){
|
|
m_currentPattern = pattern;
|
|
// newLED.setRaw((int) m_currentPattern.percentToPWM());
|
|
m_LEDController.set(m_currentPattern.getValue());
|
|
}
|
|
|
|
/**
|
|
* Add your docs here.
|
|
* @return
|
|
*/
|
|
public LEDPatterns getPattern() {
|
|
return m_currentPattern;
|
|
}
|
|
|
|
} |