mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
33 lines
824 B
C++
33 lines
824 B
C++
#include "$classname.h"
|
|
#include "../RobotMap.h"
|
|
#include "SmartDashboard/SmartDashboard.h"
|
|
#include "LiveWindow/LiveWindow.h"
|
|
|
|
$classname::$classname() :
|
|
PIDSubsystem("$classname", 1.0, 0.0, 0.0)
|
|
{
|
|
// Use these to get going:
|
|
// SetSetpoint() - Sets where the PID controller should move the system
|
|
// to
|
|
// Enable() - Enables the PID controller.
|
|
}
|
|
|
|
double $classname::ReturnPIDInput()
|
|
{
|
|
// Return your input value for the PID loop
|
|
// e.g. a sensor, like a potentiometer:
|
|
// yourPot->SetAverageVoltage() / kYourMaxVoltage;
|
|
}
|
|
|
|
void $classname::UsePIDOutput(double output)
|
|
{
|
|
// Use output to drive your system, like a motor
|
|
// e.g. yourMotor->Set(output);
|
|
}
|
|
|
|
void $classname::InitDefaultCommand()
|
|
{
|
|
// Set the default command for a subsystem here.
|
|
//setDefaultCommand(new MySpecialCommand());
|
|
}
|