2025-01-04 16:09:10 -07:00
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
/* Copyright (c) 2018 FIRST. All Rights Reserved. */
|
|
|
|
|
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
|
|
|
|
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
|
|
|
|
/* the project. */
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
package frc4388.robot.subsystems;
|
|
|
|
|
|
|
|
|
|
import edu.wpi.first.wpilibj.AddressableLED;
|
|
|
|
|
import edu.wpi.first.wpilibj.AddressableLEDBuffer;
|
|
|
|
|
import edu.wpi.first.wpilibj.motorcontrol.Spark;
|
|
|
|
|
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
|
|
|
|
|
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 {
|
|
|
|
|
|
2025-02-26 16:05:18 -07:00
|
|
|
private static Spark LEDController = new Spark(LEDConstants.LED_SPARK_ID);
|
|
|
|
|
private double mode = LEDConstants.DEFAULT_PATTERN.getValue();
|
2025-01-04 16:09:10 -07:00
|
|
|
|
2025-02-26 16:05:18 -07:00
|
|
|
public void setMode(LEDPatterns pattern){
|
|
|
|
|
this.mode = pattern.getValue();
|
2025-01-04 16:09:10 -07:00
|
|
|
}
|
2025-02-26 16:05:18 -07:00
|
|
|
|
2025-01-04 16:09:10 -07:00
|
|
|
@Override
|
2025-02-26 16:05:18 -07:00
|
|
|
public void periodic() {
|
|
|
|
|
LEDController.set(mode);
|
2025-01-04 16:09:10 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|