Files
allwpilib/eclipse-plugins/edu.wpi.first.wpilib.plugins.java/resources/templates/command-based/PIDSubsystem.java
2013-12-15 18:30:16 -05:00

35 lines
941 B
Java

package $package;
import edu.wpi.first.wpilibj.command.PIDSubsystem;
/**
*
*/
public class $classname extends PIDSubsystem {
// Initialize your subsystem here
public $classname() {
// Use these to get going:
// setSetpoint() - Sets where the PID controller should move the system
// to
// enable() - Enables the PID controller.
}
public void initDefaultCommand() {
// Set the default command for a subsystem here.
//setDefaultCommand(new MySpecialCommand());
}
protected double returnPIDInput() {
// Return your input value for the PID loop
// e.g. a sensor, like a potentiometer:
// yourPot.getAverageVoltage() / kYourMaxVoltage;
return 0.0;
}
protected void usePIDOutput(double output) {
// Use output to drive your system, like a motor
// e.g. yourMotor.set(output);
}
}