2
0
mirror of https://github.com/team2059/Dent synced 2025-01-07 22:14:14 -05:00

Added second bin elevator motor

This commit is contained in:
Austen Adler 2015-04-15 10:35:44 -04:00
parent a0018675ac
commit 3a77b38ff9
3 changed files with 8 additions and 4 deletions

View File

@ -14,7 +14,8 @@
#define ELEVATOR_ENCODERB 9 #define ELEVATOR_ENCODERB 9
// BinElevator // BinElevator
#define BINELEVATOR_CAN 10 #define BINELEVATOR_LEFT_CAN 13
#define BINELEVATOR_RIGHT_CAN 14
#define BINELEVATOR_BOTTOM_DIO 6 #define BINELEVATOR_BOTTOM_DIO 6
#define BINELEVATOR_COLELCT_BIN_DIO 7 #define BINELEVATOR_COLELCT_BIN_DIO 7
#define BINELEVATOR_TOP_DIO 12 #define BINELEVATOR_TOP_DIO 12

View File

@ -1,7 +1,8 @@
#include "BinElevator.h" #include "BinElevator.h"
#include "../RobotMap.h" #include "../RobotMap.h"
BinElevator::BinElevator(){ BinElevator::BinElevator(){
motor = new CANTalon(BINELEVATOR_CAN); leftMotor = new CANTalon(BINELEVATOR_LEFT_CAN);
rightMotor = new CANTalon(BINELEVATOR_RIGHT_CAN);
elevatorEncoder = new Encoder(BINELEVATOR_ENCODERA, BINELEVATOR_ENCODERB, false); elevatorEncoder = new Encoder(BINELEVATOR_ENCODERA, BINELEVATOR_ENCODERB, false);
elevatorBottom = new DigitalInput(BINELEVATOR_BOTTOM_DIO); elevatorBottom = new DigitalInput(BINELEVATOR_BOTTOM_DIO);
elevatorTop = new DigitalInput(BINELEVATOR_TOP_DIO); elevatorTop = new DigitalInput(BINELEVATOR_TOP_DIO);
@ -9,7 +10,8 @@ BinElevator::BinElevator(){
void BinElevator::InitDefaultCommand(){ void BinElevator::InitDefaultCommand(){
} }
void BinElevator::Run(double power){ void BinElevator::Run(double power){
motor->Set(power); leftMotor->Set(power);
rightMotor->Set(-power);
} }
void BinElevator::ResetEncoder(){ void BinElevator::ResetEncoder(){
elevatorEncoder->Reset(); elevatorEncoder->Reset();

View File

@ -8,7 +8,8 @@
*/ */
class BinElevator{ class BinElevator{
private: private:
CANTalon *motor; //<! The bin elevator motor CANTalon *leftMotor,//<! The left bin elevator motor
*rightMotor; //<! The right bin elevator motor
Encoder *elevatorEncoder; //<! The bin elevator encoder (unused) Encoder *elevatorEncoder; //<! The bin elevator encoder (unused)
DigitalInput *elevatorBottom, //<! The bottom bin elevator sensor (unused) DigitalInput *elevatorBottom, //<! The bottom bin elevator sensor (unused)
*elevatorTop; //<! The top bin elevator sensor (unused) *elevatorTop; //<! The top bin elevator sensor (unused)