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

Updated binElevator

This commit is contained in:
Austen Adler 2015-02-11 20:49:56 -05:00
parent 0831c1084b
commit e26b7e825c
2 changed files with 1 additions and 9 deletions

View File

@ -3,25 +3,19 @@
BinElevator::BinElevator(){
motor=new CANTalon(BINELEVATOR_CAN);
elevatorEncoder=new Encoder(BINELEVATOR_ENCODERA,BINELEVATOR_ENCODERB,false);
offset=0;
height=0;
elevatorBottom=new DigitalInput(BINELEVATOR_BOTTOM_DIO);
elevatorTop=new DigitalInput(BINELEVATOR_TOP_DIO);
//SetAbsoluteTolerance(0.004);
}
void BinElevator::InitDefaultCommand(){
}
void BinElevator::Run(double power){
motor->Set(power);
}
void BinElevator::SetOffset(double ht){
offset=ht;
}
void BinElevator::ResetEncoder(){
elevatorEncoder->Reset();
}
double BinElevator::GetHeight(){
return elevatorEncoder->Get()+offset;
return elevatorEncoder->Get();
}
bool BinElevator::GetElevatorBottom(){
return elevatorBottom->Get();

View File

@ -8,13 +8,11 @@ class BinElevator{
CANTalon *motor;
Encoder *elevatorEncoder;
static constexpr double kP_real=4, kI_real=.0f, kP_simulation=18, kI_simulation=.2;
double offset, height;
DigitalInput *elevatorBottom, *elevatorTop;
public:
BinElevator();
void InitDefaultCommand();
void Run(double);
void SetOffset(double);
void ResetEncoder();
double GetHeight();
bool GetElevatorTop();