mirror of
https://github.com/team2059/Dent
synced 2025-01-07 22:14:14 -05:00
Collector now works
This commit is contained in:
parent
f61920501d
commit
dd03181a04
@ -21,6 +21,7 @@ void HHBase::DisabledPeriodic(){}
|
|||||||
void HHBase::AutonomousPeriodic(){
|
void HHBase::AutonomousPeriodic(){
|
||||||
}
|
}
|
||||||
void HHBase::TeleopPeriodic(){
|
void HHBase::TeleopPeriodic(){
|
||||||
|
hhbot->Handler();
|
||||||
}
|
}
|
||||||
void HHBase::Test(){}
|
void HHBase::Test(){}
|
||||||
START_ROBOT_CLASS(HHBase);
|
START_ROBOT_CLASS(HHBase);
|
||||||
|
@ -28,9 +28,9 @@ void HHRobot::Handler(){
|
|||||||
hhdrive->MecanumDrive_Cartesian(joystick1->GetJoystickAxis("z"), joystick1->GetJoystickAxis("y"), joystick1->GetJoystickAxis("x"));
|
hhdrive->MecanumDrive_Cartesian(joystick1->GetJoystickAxis("z"), joystick1->GetJoystickAxis("y"), joystick1->GetJoystickAxis("x"));
|
||||||
}
|
}
|
||||||
if(joystick1->GetJoystickButton(11)){
|
if(joystick1->GetJoystickButton(11)){
|
||||||
collector->Collect(255);
|
collector->Collect(-1.0f);
|
||||||
}else if(joystick1->GetJoystickButton(12)){
|
}else if(joystick1->GetJoystickButton(12)){
|
||||||
collector->Collect(1);
|
collector->Collect(1.0f);
|
||||||
}else if(joystick1->GetJoystickButton(9)){
|
}else if(joystick1->GetJoystickButton(9)){
|
||||||
collector->Raise(255);
|
collector->Raise(255);
|
||||||
}else if(joystick1->GetJoystickButton(10)){
|
}else if(joystick1->GetJoystickButton(10)){
|
||||||
|
@ -1,22 +1,22 @@
|
|||||||
#include "Collector.h"
|
#include "Collector.h"
|
||||||
DentCollector::DentCollector(int fl, int fr, int rl, int rr){
|
DentCollector::DentCollector(int fl, int fr, int rl, int rr){
|
||||||
frontLeft = new Talon(fl);
|
collectorLeft = new Talon(fl);
|
||||||
frontRight = new Talon(fr);
|
collectorRight = new Talon(fr);
|
||||||
raiserLeft = new Talon(rl);
|
raiserLeft = new Talon(rl);
|
||||||
raiserRight = new Talon(rr);
|
raiserRight = new Talon(rr);
|
||||||
}
|
}
|
||||||
void DentCollector::Collect(int power){
|
void DentCollector::Collect(float power){
|
||||||
frontLeft->Set(power);
|
collectorLeft->Set(power);
|
||||||
frontRight->Set(power);
|
collectorRight->Set(power);
|
||||||
}
|
}
|
||||||
void DentCollector::Raise(int power){
|
void DentCollector::Raise(float power){
|
||||||
raiserLeft->Set(power);
|
raiserLeft->Set(power);
|
||||||
raiserRight->Set(power);
|
raiserRight->Set(power);
|
||||||
}
|
}
|
||||||
void DentCollector::Rest(){
|
void DentCollector::Rest(){
|
||||||
raiserLeft->Set(0);
|
raiserLeft->Set(0);
|
||||||
raiserRight->Set(0);
|
raiserRight->Set(0);
|
||||||
frontLeft->Set(0);
|
collectorLeft->Set(0);
|
||||||
frontRight->Set(0);
|
collectorRight->Set(0);
|
||||||
}
|
}
|
||||||
// vim: ts=2:sw=2:et
|
// vim: ts=2:sw=2:et
|
||||||
|
@ -4,11 +4,11 @@
|
|||||||
//#include ""
|
//#include ""
|
||||||
class DentCollector{
|
class DentCollector{
|
||||||
private:
|
private:
|
||||||
Talon *frontLeft, *frontRight, *raiserLeft, *raiserRight;
|
Talon *collectorLeft, *collectorRight, *raiserLeft, *raiserRight;
|
||||||
public:
|
public:
|
||||||
DentCollector(int, int, int, int);
|
DentCollector(int, int, int, int);
|
||||||
void Collect(int);
|
void Collect(float);
|
||||||
void Raise(int);
|
void Raise(float);
|
||||||
void Rest();
|
void Rest();
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user