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

27 lines
628 B
C++
Raw Normal View History

2015-02-10 20:12:41 -05:00
#include "BinLower.h"
#include "../../DentRobot.h"
#include "../../OI.h"
2015-03-09 07:25:11 -04:00
BinLower::BinLower(float timeout): Command("BinLower"){
2015-03-07 13:27:11 -05:00
SetTimeout(timeout);
2015-02-10 20:12:41 -05:00
}
void BinLower::Initialize(){
}
void BinLower::Execute(){
DentRobot::binElevator->Run(-1.0);
}
bool BinLower::IsFinished(){
2015-03-09 07:25:11 -04:00
if(/*!DentRobot::binElevator->GetElevatorBottom()||*/IsTimedOut()){
2015-02-10 20:12:41 -05:00
printf("Robot stoped BinLowering. Sensor based? %d\n", !DentRobot::binElevator->GetElevatorBottom());
return true;
}else{
return false;
}
}
void BinLower::End(){
DentRobot::binElevator->Run(0.0f);
}
void BinLower::Interrupted(){
End();
}
// vim: ts=2:sw=2:et