Files
Robot-Essentials/src/main/java/frc4388/robot/commands/LED/SetLEDPattern.java
T

35 lines
1.2 KiB
Java
Raw Normal View History

2019-08-04 16:19:40 -06:00
/*----------------------------------------------------------------------------*/
2020-01-05 18:59:50 -07:00
/* Copyright (c) 2019 FIRST. All Rights Reserved. */
2019-08-04 16:19:40 -06:00
/* 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. */
/*----------------------------------------------------------------------------*/
2019-12-21 20:41:34 -07:00
package frc4388.robot.commands.LED;
2019-08-04 16:19:40 -06:00
2020-01-05 18:59:50 -07:00
import edu.wpi.first.wpilibj2.command.InstantCommand;
2019-08-04 16:19:40 -06:00
2020-01-05 18:59:50 -07:00
import frc4388.robot.subsystems.LED;
2020-01-05 20:23:52 -07:00
import frc4388.utility.LEDPatterns;
2019-08-04 16:19:40 -06:00
2020-01-05 18:59:50 -07:00
// NOTE: Consider using this command inline, rather than writing a subclass. For more
// information, see:
// https://docs.wpilib.org/en/latest/docs/software/commandbased/convenience-features.html
public class SetLEDPattern extends InstantCommand {
2019-08-04 16:19:40 -06:00
2020-01-05 18:59:50 -07:00
private final LED m_led;
2019-08-07 18:46:31 -06:00
public static LEDPatterns m_pattern;
2019-08-04 16:19:40 -06:00
2020-01-05 18:59:50 -07:00
public SetLEDPattern(LED subsystem, LEDPatterns pattern) {
m_led = subsystem;
2019-08-07 18:46:31 -06:00
m_pattern = pattern;
2020-01-05 18:59:50 -07:00
addRequirements(m_led);
2019-08-04 16:19:40 -06:00
}
2020-01-05 18:59:50 -07:00
// Called when the command is initially scheduled.
2019-08-04 16:19:40 -06:00
@Override
2020-01-05 18:59:50 -07:00
public void initialize() {
m_led.setPattern(m_pattern);
2019-08-04 16:19:40 -06:00
}
}