Implemented CommandBase, hopefully more correct than before
This commit is contained in:
parent
135f031ae5
commit
089bab94d1
@ -0,0 +1,9 @@
|
|||||||
|
package org.usfirst.frc.team2059.robot.commands;
|
||||||
|
import org.usfirst.frc.team2059.robot.subsystems.Drivebase;
|
||||||
|
import org.usfirst.frc.team2059.robot.subsystems.Encoderbase;
|
||||||
|
import edu.wpi.first.wpilibj.command.Command;
|
||||||
|
public abstract class CommandBase extends Command{
|
||||||
|
protected static Encoderbase encoderbase = new Encoderbase();
|
||||||
|
protected static Drivebase drivebase = new Drivebase();
|
||||||
|
}
|
||||||
|
// vim: sw=2:ts=2:sts=2
|
@ -1,7 +1,8 @@
|
|||||||
package org.usfirst.frc.team2059.robot.commands;
|
package org.usfirst.frc.team2059.robot.commands;
|
||||||
import edu.wpi.first.wpilibj.command.Command;
|
import org.usfirst.frc.team2059.robot.commands.CommandBase;
|
||||||
public class LogEncoder extends Command {
|
public class LogEncoder extends CommandBase {
|
||||||
public LogEncoder() {
|
public LogEncoder() {
|
||||||
|
requires(encoderbase);
|
||||||
}
|
}
|
||||||
protected void initialize() {
|
protected void initialize() {
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,20 @@
|
|||||||
|
package org.usfirst.frc.team2059.robot.commands;
|
||||||
|
import org.usfirst.frc.team2059.robot.commands.CommandBase;
|
||||||
|
public class ResetEncoder extends CommandBase {
|
||||||
|
public ResetEncoder() {
|
||||||
|
requires(encoderbase);
|
||||||
|
}
|
||||||
|
protected void initialize() {
|
||||||
|
}
|
||||||
|
protected boolean isFinished() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
protected void execute() {
|
||||||
|
encoderbase.resetEncoder();
|
||||||
|
}
|
||||||
|
protected void end() {
|
||||||
|
}
|
||||||
|
protected void interrupted() {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// vim: sw=2:ts=2:sts=2
|
Loading…
x
Reference in New Issue
Block a user