2
0
mirror of https://github.com/team2059/Dent synced 2024-12-18 20:52:29 -05:00
dent/Commands/Elevator/Calibrate.cpp

27 lines
675 B
C++
Raw Normal View History

#include "Calibrate.h"
#include "../../DentRobot.h"
// Lowers elevator until it hits the limit switch then sets the height of the elevator to the height of the limit switches
Calibrate::Calibrate() : Command("Calibrate"){
}
void Calibrate::Initialize(){
}
void Calibrate::Execute(){
// Lower collector until End()
DentRobot::elevator->Run(-0.4f);
}
bool Calibrate::IsFinished(){
if(DentRobot::elevator->GetElevatorBottom()){
DentRobot::elevator->ResetEncoder();
DentRobot::elevator->SetOffset(0.99);
return true;
}
return false;
}
void Calibrate::End(){
DentRobot::elevator->Run(0.0f);
}
void Calibrate::Interrupted(){
End();
}
2015-02-08 12:26:15 -05:00
// vim: ts=2:sw=2:et