mirror of
https://github.com/team2059/Dent
synced 2024-12-18 20:52:29 -05:00
Continued development of elevator (not working)
This commit is contained in:
parent
814ddb1579
commit
760a30a8a2
@ -1,14 +1,21 @@
|
|||||||
#include "Calibrate.h"
|
#include "Calibrate.h"
|
||||||
#include "../DentRobot.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"){
|
Calibrate::Calibrate() : Command("Calibrate"){
|
||||||
}
|
}
|
||||||
void Calibrate::Initialize(){
|
void Calibrate::Initialize(){
|
||||||
}
|
}
|
||||||
void Calibrate::Execute(){
|
void Calibrate::Execute(){
|
||||||
|
// Lower collector until End()
|
||||||
DentRobot::elevator->Run(-0.4f);
|
DentRobot::elevator->Run(-0.4f);
|
||||||
}
|
}
|
||||||
bool Calibrate::IsFinished(){
|
bool Calibrate::IsFinished(){
|
||||||
return DentRobot::elevator->GetPotValue()>=0.1f;
|
if(DentRobot::DIO->Get()){
|
||||||
|
// 0.99 is a placeholder for the height of the limit switches
|
||||||
|
DentRobot::elevator->SetHeight(0.99);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
void Calibrate::End(){
|
void Calibrate::End(){
|
||||||
DentRobot::elevator->Run(0.0f);
|
DentRobot::elevator->Run(0.0f);
|
||||||
|
@ -13,6 +13,8 @@ float Elevator::GetPotValue(){
|
|||||||
return pot->Get();
|
return pot->Get();
|
||||||
}
|
}
|
||||||
void Elevator::Run(double power){
|
void Elevator::Run(double power){
|
||||||
|
// Height supposed to be the location of the elevator
|
||||||
|
//height+=power;
|
||||||
leftMotor->Set(power);
|
leftMotor->Set(power);
|
||||||
rightMotor->Set(power);
|
rightMotor->Set(power);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user