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

32 lines
992 B
C++
Raw Normal View History

2015-01-16 19:29:55 -05:00
#include "Collector.h"
#include "../RobotMap.h"
2015-07-31 12:52:15 -04:00
Collector::Collector(): Subsystem("Collector") {
2015-03-23 10:52:02 -04:00
collectorMotorLeft = new CANTalon(COLLECTOR_LEFT_CAN);
collectorMotorBottom = new CANTalon(COLLECTOR_BOTTOM_CAN);
collectorMotorRamp = new CANTalon(COLLECTOR_RAMP_CAN);
collectorMotorRight = new CANTalon(COLLECTOR_RIGHT_CAN);
sonarAnalog = new AnalogInput(COLLECTOR_SONAR_ANALOG);
}
2015-09-19 17:57:42 -04:00
void Collector::InitDefaultCommand() {}
2015-07-31 12:52:15 -04:00
void Collector::MoveRollers(double power) {
2015-03-21 10:24:33 -04:00
MoveLeftRoller(power);
MoveRightRoller(-power);
MoveBottomRollers(power);
printf("Roller power: %f\n", power);
}
2015-07-31 12:52:15 -04:00
void Collector::MoveLeftRoller(double power) {
collectorMotorLeft->Set(power);
2015-03-21 10:24:33 -04:00
}
2015-07-31 12:52:15 -04:00
void Collector::MoveRightRoller(double power) {
2015-03-21 10:24:33 -04:00
collectorMotorRight->Set(power);
}
2015-07-31 12:52:15 -04:00
void Collector::MoveBottomRollers(double power) {
collectorMotorBottom->Set(-power);
collectorMotorRamp->Set(power);
2015-02-15 07:53:19 -05:00
}
2015-07-31 12:52:15 -04:00
double Collector::GetSonarDistance() {
2015-02-15 17:10:20 -05:00
return sonarAnalog->GetAverageVoltage();
}
2015-02-08 12:26:15 -05:00
// vim: ts=2:sw=2:et