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

29 lines
815 B
C++
Raw Permalink Normal View History

2015-02-10 20:12:41 -05:00
#include "BinElevator.h"
#include "../RobotMap.h"
2015-07-31 12:52:15 -04:00
BinElevator::BinElevator() {
2015-04-15 10:35:44 -04:00
leftMotor = new CANTalon(BINELEVATOR_LEFT_CAN);
rightMotor = new CANTalon(BINELEVATOR_RIGHT_CAN);
2015-03-23 10:52:02 -04:00
elevatorEncoder = new Encoder(BINELEVATOR_ENCODERA, BINELEVATOR_ENCODERB, false);
elevatorBottom = new DigitalInput(BINELEVATOR_BOTTOM_DIO);
elevatorTop = new DigitalInput(BINELEVATOR_TOP_DIO);
2015-02-10 20:12:41 -05:00
}
2015-07-31 12:52:15 -04:00
void BinElevator::InitDefaultCommand() {
2015-02-10 20:12:41 -05:00
}
2015-07-31 12:52:15 -04:00
void BinElevator::Run(double power) {
2015-04-15 10:35:44 -04:00
leftMotor->Set(power);
rightMotor->Set(-power);
2015-02-10 20:12:41 -05:00
}
2015-07-31 12:52:15 -04:00
void BinElevator::ResetEncoder() {
2015-02-10 20:12:41 -05:00
elevatorEncoder->Reset();
}
2015-07-31 12:52:15 -04:00
double BinElevator::GetHeight() {
2015-02-11 20:49:56 -05:00
return elevatorEncoder->Get();
2015-02-10 20:12:41 -05:00
}
2015-07-31 12:52:15 -04:00
bool BinElevator::GetElevatorBottom() {
2015-02-10 20:12:41 -05:00
return elevatorBottom->Get();
}
2015-07-31 12:52:15 -04:00
bool BinElevator::GetElevatorTop() {
2015-02-10 20:12:41 -05:00
return elevatorTop->Get();
}
// vim: ts=2:sw=2:et