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

Collector now works

This commit is contained in:
Austen Adler 2015-01-10 11:46:30 -05:00
parent f61920501d
commit dd03181a04
4 changed files with 14 additions and 13 deletions

View File

@ -21,6 +21,7 @@ void HHBase::DisabledPeriodic(){}
void HHBase::AutonomousPeriodic(){
}
void HHBase::TeleopPeriodic(){
hhbot->Handler();
}
void HHBase::Test(){}
START_ROBOT_CLASS(HHBase);

View File

@ -28,9 +28,9 @@ void HHRobot::Handler(){
hhdrive->MecanumDrive_Cartesian(joystick1->GetJoystickAxis("z"), joystick1->GetJoystickAxis("y"), joystick1->GetJoystickAxis("x"));
}
if(joystick1->GetJoystickButton(11)){
collector->Collect(255);
collector->Collect(-1.0f);
}else if(joystick1->GetJoystickButton(12)){
collector->Collect(1);
collector->Collect(1.0f);
}else if(joystick1->GetJoystickButton(9)){
collector->Raise(255);
}else if(joystick1->GetJoystickButton(10)){

View File

@ -1,22 +1,22 @@
#include "Collector.h"
DentCollector::DentCollector(int fl, int fr, int rl, int rr){
frontLeft = new Talon(fl);
frontRight = new Talon(fr);
collectorLeft = new Talon(fl);
collectorRight = new Talon(fr);
raiserLeft = new Talon(rl);
raiserRight = new Talon(rr);
}
void DentCollector::Collect(int power){
frontLeft->Set(power);
frontRight->Set(power);
void DentCollector::Collect(float power){
collectorLeft->Set(power);
collectorRight->Set(power);
}
void DentCollector::Raise(int power){
void DentCollector::Raise(float power){
raiserLeft->Set(power);
raiserRight->Set(power);
}
void DentCollector::Rest(){
raiserLeft->Set(0);
raiserRight->Set(0);
frontLeft->Set(0);
frontRight->Set(0);
collectorLeft->Set(0);
collectorRight->Set(0);
}
// vim: ts=2:sw=2:et

View File

@ -4,11 +4,11 @@
//#include ""
class DentCollector{
private:
Talon *frontLeft, *frontRight, *raiserLeft, *raiserRight;
Talon *collectorLeft, *collectorRight, *raiserLeft, *raiserRight;
public:
DentCollector(int, int, int, int);
void Collect(int);
void Raise(int);
void Collect(float);
void Raise(float);
void Rest();
};
#endif