2015-02-10 20:12:41 -05:00
|
|
|
#include "BinElevator.h"
|
|
|
|
#include "../RobotMap.h"
|
|
|
|
BinElevator::BinElevator(){
|
2015-02-11 18:34:38 -05:00
|
|
|
motor=new CANTalon(BINELEVATOR_CAN);
|
2015-02-27 15:44:18 -05:00
|
|
|
elevatorEncoder=new Encoder(BINELEVATOR_ENCODERA, BINELEVATOR_ENCODERB, false);
|
2015-02-11 18:34:38 -05:00
|
|
|
elevatorBottom=new DigitalInput(BINELEVATOR_BOTTOM_DIO);
|
|
|
|
elevatorTop=new DigitalInput(BINELEVATOR_TOP_DIO);
|
2015-02-10 20:12:41 -05:00
|
|
|
}
|
|
|
|
void BinElevator::InitDefaultCommand(){
|
|
|
|
}
|
|
|
|
void BinElevator::Run(double power){
|
|
|
|
motor->Set(power);
|
|
|
|
}
|
|
|
|
void BinElevator::ResetEncoder(){
|
|
|
|
elevatorEncoder->Reset();
|
|
|
|
}
|
|
|
|
double BinElevator::GetHeight(){
|
2015-02-11 20:49:56 -05:00
|
|
|
return elevatorEncoder->Get();
|
2015-02-10 20:12:41 -05:00
|
|
|
}
|
|
|
|
bool BinElevator::GetElevatorBottom(){
|
2015-02-24 12:02:30 -05:00
|
|
|
SmartDashboard::PutBoolean("Bin Elevator Bottom", elevatorBottom->Get());
|
2015-02-10 20:12:41 -05:00
|
|
|
return elevatorBottom->Get();
|
|
|
|
}
|
|
|
|
bool BinElevator::GetElevatorTop(){
|
2015-02-24 12:02:30 -05:00
|
|
|
SmartDashboard::PutBoolean("Bin Elevator Top", elevatorTop->Get());
|
2015-02-10 20:12:41 -05:00
|
|
|
return elevatorTop->Get();
|
|
|
|
}
|
|
|
|
// vim: ts=2:sw=2:et
|