Files
allwpilib/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/examples/PacGoat/src/Commands/SetPivotSetpoint.cpp
Alex Henning c7e17b8e35 Added PacGoat code for C++.
Change-Id: I4fd19fbdc65c25c5bbcdce937a31bc6fa1c11cb4
2014-06-25 16:49:14 -07:00

31 lines
789 B
C++

#include "SetPivotSetpoint.h"
#include "Robot.h"
SetPivotSetpoint::SetPivotSetpoint(double setpoint) {
this->setpoint = setpoint;
Requires(Robot::pivot);
}
// Called just before this Command runs the first time
void SetPivotSetpoint::Initialize() {
Robot::pivot->Enable();
Robot::pivot->SetSetpoint(setpoint);
}
// Called repeatedly when this Command is scheduled to run
void SetPivotSetpoint::Execute() {}
// Make this return true when this Command no longer needs to run execute()
bool SetPivotSetpoint::IsFinished()
{
return Robot::pivot->OnTarget();
}
// Called once after isFinished returns true
void SetPivotSetpoint::End() {}
// Called when another command which requires one or more of the same
// subsystems is scheduled to run
void SetPivotSetpoint::Interrupted() {}