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

52 lines
1.4 KiB
Java
Raw Normal View History

2019-08-04 16:19:40 -06: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. */
/*----------------------------------------------------------------------------*/
2019-12-21 20:41:34 -07:00
package frc4388.robot.commands.LED;
2019-08-04 16:19:40 -06:00
import frc4388.robot.Robot;
import frc4388.robot.constants.LEDPatterns;
import edu.wpi.first.wpilibj.command.Command;
2019-12-21 20:41:34 -07:00
public class SetLEDPattern extends Command {
2019-08-04 16:19:40 -06:00
2019-08-07 18:46:31 -06:00
public static LEDPatterns m_pattern;
2019-08-04 16:19:40 -06:00
2019-12-21 20:41:34 -07:00
public SetLEDPattern(LEDPatterns pattern) {
2019-08-07 18:46:31 -06:00
requires(Robot.m_led);
m_pattern = pattern;
2019-08-04 16:19:40 -06:00
}
// Called just before this Command runs the first time
@Override
protected void initialize() {
}
// Called repeatedly when this Command is scheduled to run
@Override
protected void execute() {
2019-08-07 18:46:31 -06:00
Robot.m_led.setPattern(m_pattern);
2019-08-04 16:19:40 -06:00
}
// Make this return true when this Command no longer needs to run execute()
@Override
protected boolean isFinished() {
return true;
}
// Called once after isFinished returns true
@Override
protected void end() {
}
// Called when another command which requires one or more of the same
// subsystems is scheduled to run
@Override
protected void interrupted() {
}
}