LED Command Based

This commit is contained in:
Keenan D. Buckley
2019-12-21 20:41:34 -07:00
parent c690466356
commit ec873a2835
6 changed files with 62 additions and 12 deletions
@@ -25,7 +25,7 @@ public class GamerMove extends Command {
// Called repeatedly when this Command is scheduled to run
@Override
protected void execute() {
Robot.m_Drive.gamerMove();
Robot.m_Drive.driveWithInput(0, 1);
}
// Make this return true when this Command no longer needs to run execute()
@@ -5,18 +5,18 @@
/* the project. */
/*----------------------------------------------------------------------------*/
package frc4388.robot.commands;
package frc4388.robot.commands.LED;
import frc4388.robot.Robot;
import frc4388.robot.constants.LEDPatterns;
import edu.wpi.first.wpilibj.command.Command;
public class setLEDPattern extends Command {
public class SetLEDPattern extends Command {
public static LEDPatterns m_pattern;
public setLEDPattern(LEDPatterns pattern) {
public SetLEDPattern(LEDPatterns pattern) {
requires(Robot.m_led);
m_pattern = pattern;
}
@@ -0,0 +1,46 @@
/*----------------------------------------------------------------------------*/
/* 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.LED;
import edu.wpi.first.wpilibj.command.Command;
import frc4388.robot.Robot;
public class UpdateLED extends Command {
public UpdateLED() {
// Use requires() here to declare subsystem dependencies
requires(Robot.m_led);
}
// 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.m_led.updateLED();
}
// Make this return true when this Command no longer needs to run execute()
@Override
protected boolean isFinished() {
return false;
}
// 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() {
}
}