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

changed method for half speed button

This commit is contained in:
Adam Long 2015-10-10 05:58:54 +00:00
parent 20b5107d05
commit b121aade16
3 changed files with 6 additions and 6 deletions

View File

@ -8,6 +8,9 @@ Lower::Lower(double timeout, bool useSoftLimits, double liftSpeed): Command("Low
}
void Lower::Initialize() {}
void Lower::Execute() {
if(DentRobot::oi->GetRightStick()->GetRawButton(11)){
speed*=0.5;
}
DentRobot::elevator->Run(speed);
}
bool Lower::IsFinished() {

View File

@ -8,6 +8,9 @@ Raise::Raise(double timeout, bool useSoftLimits, double liftSpeed): Command("Rai
}
void Raise::Initialize() {}
void Raise::Execute() {
if(DentRobot::oi->GetRightStick()->GetRawButton(11)){
speed*=0.5;
}
DentRobot::elevator->Run(speed);
}
bool Raise::IsFinished() {

6
OI.cpp
View File

@ -42,19 +42,13 @@ OI::OI() {
cycle = new ElevatorCycle();
JoystickButton *left11 = new JoystickButton(leftStick, 11);
JoystickButton *left12 = new JoystickButton(leftStick, 12);
JoystickButton *right3 = new JoystickButton(rightStick, 3);
JoystickButton *right4 = new JoystickButton(rightStick, 4);
JoystickButton *right5 = new JoystickButton(rightStick, 5);
JoystickButton *right6 = new JoystickButton(rightStick, 6);
left11->WhenPressed(new OpenArm(2));
left12->WhenPressed(new CloseArm(2));
//Full speed lift
right4->WhileHeld(new Lower(3.5,false,1));
right6->WhileHeld(new Raise(3.5,false,-1));
//Half speed lift
right5->WhileHeld(new Raise(3.5,false,-0.5));
right5->WhileHeld(new RollIn(0.35));
right3->WhileHeld(new Lower(3.5,false,0.5));
// BinCollector