Skip to content
This repository has been archived by the owner on Jan 16, 2024. It is now read-only.

Commit

Permalink
added second solenoid
Browse files Browse the repository at this point in the history
  • Loading branch information
PichuIsBest committed Dec 12, 2023
1 parent 395526e commit cb626b7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/main/java/org/team1540/bunnybotTank2023/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ public static class DrivetrainConstants {
}

public static class IntakeConstants {
public static final int SOLENOID_PORT_NUMBER = 1;
public static final int SOLENOID_1_PORT_NUMBER = 1;
public static final int SOLENOID_2_PORT_NUMBER = 2;
public static final int MOTOR_ID = 5;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,24 @@
import javax.naming.ldap.Control;

public class IntakeIOReal implements IntakeIO {
private final Solenoid solenoid = new Solenoid(PneumaticsModuleType.CTREPCM, Constants.IntakeConstants.SOLENOID_PORT_NUMBER);
private final Solenoid solenoid1 = new Solenoid(PneumaticsModuleType.CTREPCM, Constants.IntakeConstants.SOLENOID_1_PORT_NUMBER);
private final Solenoid solenoid2 = new Solenoid(PneumaticsModuleType.CTREPCM, Constants.IntakeConstants.SOLENOID_2_PORT_NUMBER);
private final VictorSPX motor = new VictorSPX(Constants.IntakeConstants.MOTOR_ID);
public IntakeIOReal() {
solenoid.set(false);
solenoid1.set(false);
solenoid2.set(false);
motor.setNeutralMode(NeutralMode.Brake);
motor.setInverted(false);
}
@Override
public void setFold(boolean fold) {
solenoid.set(fold);
solenoid1.set(fold);
solenoid2.set(fold);
}

@Override
public void updateInputs(IntakeInputs inputs) {
inputs.folded = solenoid.get();
inputs.folded = solenoid1.get();
inputs.motorAppliedVolts = motor.getMotorOutputVoltage();
inputs.motorCurrentAmps = motor.getMotorOutputPercent();
inputs.motorVelocity = motor.getActiveTrajectoryVelocity();
Expand Down

0 comments on commit cb626b7

Please sign in to comment.