Add Blinken LED functionality

This commit is contained in:
HFocus
2019-08-04 16:19:40 -06:00
parent 2b0cad989c
commit dc957675d3
6 changed files with 136 additions and 1 deletions
@@ -0,0 +1,51 @@
/*----------------------------------------------------------------------------*/
/* 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.commands;
import frc4388.robot.Robot;
import frc4388.robot.constants.LEDPatterns;
import edu.wpi.first.wpilibj.command.Command;
public class setLEDPattern extends Command {
LEDPatterns pattern;
public setLEDPattern(LEDPatterns pattern) {
requires(Robot.led);
this.pattern = pattern;
}
// 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() {
Robot.led.setPattern(pattern);
}
// 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() {
}
}