From 3a77b38ff989b0bb24762c4e5c3aced6cb949c45 Mon Sep 17 00:00:00 2001 From: Austen Adler Date: Wed, 15 Apr 2015 10:35:44 -0400 Subject: [PATCH] Added second bin elevator motor --- RobotMap.h | 3 ++- Subsystems/BinElevator.cpp | 6 ++++-- Subsystems/BinElevator.h | 3 ++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/RobotMap.h b/RobotMap.h index f6b34f8..32b0433 100644 --- a/RobotMap.h +++ b/RobotMap.h @@ -14,7 +14,8 @@ #define ELEVATOR_ENCODERB 9 // BinElevator -#define BINELEVATOR_CAN 10 +#define BINELEVATOR_LEFT_CAN 13 +#define BINELEVATOR_RIGHT_CAN 14 #define BINELEVATOR_BOTTOM_DIO 6 #define BINELEVATOR_COLELCT_BIN_DIO 7 #define BINELEVATOR_TOP_DIO 12 diff --git a/Subsystems/BinElevator.cpp b/Subsystems/BinElevator.cpp index e2ac69f..11dcf67 100644 --- a/Subsystems/BinElevator.cpp +++ b/Subsystems/BinElevator.cpp @@ -1,7 +1,8 @@ #include "BinElevator.h" #include "../RobotMap.h" 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); elevatorBottom = new DigitalInput(BINELEVATOR_BOTTOM_DIO); elevatorTop = new DigitalInput(BINELEVATOR_TOP_DIO); @@ -9,7 +10,8 @@ BinElevator::BinElevator(){ void BinElevator::InitDefaultCommand(){ } void BinElevator::Run(double power){ - motor->Set(power); + leftMotor->Set(power); + rightMotor->Set(-power); } void BinElevator::ResetEncoder(){ elevatorEncoder->Reset(); diff --git a/Subsystems/BinElevator.h b/Subsystems/BinElevator.h index 7eacc84..ba0752b 100644 --- a/Subsystems/BinElevator.h +++ b/Subsystems/BinElevator.h @@ -8,7 +8,8 @@ */ class BinElevator{ private: - CANTalon *motor; //