mirror of
https://github.com/Team4388/Robot-Essentials.git
synced 2026-06-09 00:38:01 -06:00
Formating and Conventions Work
- Moved controller code to utilities - added m_ prefix to member variables to stick with conventions
This commit is contained in:
@@ -15,6 +15,7 @@ import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
|
||||
import frc4388.robot.commands.ExampleCommand;
|
||||
import frc4388.robot.subsystems.ExampleSubsystem;
|
||||
import frc4388.robot.subsystems.LED;
|
||||
import frc4388.utility.controller.XboxController;
|
||||
|
||||
/**
|
||||
* The VM is configured to automatically run this class, and to call the
|
||||
@@ -25,7 +26,7 @@ import frc4388.robot.subsystems.LED;
|
||||
*/
|
||||
public class Robot extends TimedRobot {
|
||||
public static ExampleSubsystem m_subsystem = new ExampleSubsystem();
|
||||
public static LED led = new LED();
|
||||
public static LED m_led = new LED();
|
||||
public static OI m_oi;
|
||||
|
||||
Command m_autonomousCommand;
|
||||
|
||||
@@ -14,11 +14,11 @@ import edu.wpi.first.wpilibj.command.Command;
|
||||
|
||||
public class setLEDPattern extends Command {
|
||||
|
||||
LEDPatterns pattern;
|
||||
public static LEDPatterns m_pattern;
|
||||
|
||||
public setLEDPattern(LEDPatterns pattern) {
|
||||
requires(Robot.led);
|
||||
this.pattern = pattern;
|
||||
requires(Robot.m_led);
|
||||
m_pattern = pattern;
|
||||
}
|
||||
|
||||
// Called just before this Command runs the first time
|
||||
@@ -29,7 +29,7 @@ public class setLEDPattern extends Command {
|
||||
// Called repeatedly when this Command is scheduled to run
|
||||
@Override
|
||||
protected void execute() {
|
||||
Robot.led.setPattern(pattern);
|
||||
Robot.m_led.setPattern(m_pattern);
|
||||
}
|
||||
|
||||
// Make this return true when this Command no longer needs to run execute()
|
||||
|
||||
@@ -33,6 +33,10 @@ public enum LEDPatterns {
|
||||
|
||||
// GETTERS/SETTERS
|
||||
private final float id;
|
||||
LEDPatterns(float id) { this.id = id; }
|
||||
public float getValue() { return id; }
|
||||
LEDPatterns(float id) {
|
||||
this.id = id;
|
||||
}
|
||||
public float getValue() {
|
||||
return id;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user