Skip to content

Commit a46c028

Browse files
committed
fix elevator
1 parent 7874b8e commit a46c028

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

src/main/java/frc/robot/subsystems/Elevator.java

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,30 @@ public void periodic() {
2424
private Command moveUpOrDown(boolean goingUp) {
2525
elevator.getPosition();
2626
if (goingUp) {
27-
return runOnce(() -> elevator.setPosition(0.8));
27+
return runOnce(() -> elevator.set(0.8));
2828
}
2929
else {
30-
return runOnce(() -> elevator.set(0));
30+
return runOnce(() -> elevator.set(-0.8));
3131
}
3232
}
3333

3434
public Command motionUp() {
35-
return moveUpOrDown(true);
35+
if(elevator.getPosition() >= 1) {
36+
return runOnce(() -> elevator.set(0.5));
37+
}
38+
else{
39+
return runOnce(() -> elevator.set(0));
40+
}
41+
// return moveUpOrDown(true);
3642
}
3743

3844
public Command motionDown() {
39-
return moveUpOrDown(false);
45+
if (elevator.getPosition() >= 1 && elevator.getPosition() <= 9) {
46+
return runOnce(() -> elevator.set(-0.5));
47+
}
48+
else{
49+
return runOnce(() -> elevator.set(0));
50+
}
51+
//return moveUpOrDown(false);
4052
}
4153
}

0 commit comments

Comments
 (0)