Skip to content

Commit

Permalink
f8
Browse files Browse the repository at this point in the history
  • Loading branch information
raghavsial committed Nov 14, 2024
1 parent 846a71c commit 9b0a6b8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
9 changes: 9 additions & 0 deletions src/main/java/com/team766/robot/rookie_bot/OI.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.team766.hal.RobotProvider;
import com.team766.logging.Category;
import com.team766.robot.example.procedures.*;
import com.team766.robot.rookie_bot.procedures.PIDElevator;

/**
* This class is the glue that binds the controls on the physical operator
Expand Down Expand Up @@ -33,8 +34,16 @@ public void run(final Context context) {
RobotProvider.instance.refreshDriverStationData();

Robot.drive.setArcadeDrivePower(joystick0.getAxis(1), joystick0.getAxis(3));

if ( joystick0.getButtonPressed(4) ){
context.startAsync(new PIDElevator(false));
}
if ( joystick0.getButtonPressed(5) ){
context.startAsync(new PIDElevator(true));
}



// Add driver controls here - make sure to take/release ownership
// of mechanisms when appropriate.
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@ public class PIDElevator extends Procedure {
double setpoint;
PIDController controller;

public PIDElevator(){

this.setpoint = 1;
public PIDElevator(boolean top){
if (top == true ){
this.setpoint = 400;
}
else {
this.setpoint = 1 ;
}
}

public void run(Context context){
Expand Down

0 comments on commit 9b0a6b8

Please sign in to comment.