Skip to content

Commit

Permalink
updated shooter to account for bottom feeder resistance
Browse files Browse the repository at this point in the history
  • Loading branch information
siyoyoCode committed Feb 18, 2024
1 parent 6f915f0 commit a80a9ee
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/main/java/frc/robot/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ public static class ShooterConstants {
public static final int SHOOTER_MOTOR_TWO_ID = 14;

public static final int FEEDER_MOTOR_ID = 15;
//public static final int FEEDER_MOTOR_2_ID = 43; //CHANGE THIS

public static final double FEED_ANGLE = Units.degreesToRadians(70);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ public class ShooterFeederSubsystem extends SubsystemBase{
public final double FEEDER_MOTOR_SPEED = .8;
public final int NO_NOTE_TOLERANCE = 500; //must test with no note in front of sensor
public final int TOLERANCE = 1000; //represents the value when half note is in front of sensor
private final double FEEDER_MOTOR_RESISTANCE = 1.01;

//motors
private final TalonSRX feederMotor;
//private final TalonSRX feederMotor2;

//devices
private final ColorSensorV3 shooterSensor; //distance sensor
Expand All @@ -25,12 +27,16 @@ public ShooterFeederSubsystem(){
feederMotor = new TalonSRX(FEEDER_MOTOR_ID);
feederMotor.setInverted(true);

// feederMotor2 = new TalonSRX(FEEDER_MOTOR_2_ID);
// feederMotor.setInverted(true);

//sensors
shooterSensor = new ColorSensorV3(I2C.Port.kMXP);
}

public void setFeederMotorSpeed(double speed){
feederMotor.set(TalonSRXControlMode.PercentOutput, speed);
//feederMotor2.set(TalonSRXControlMode.PercentOutput, speed*FEEDER_MOTOR_RESISTANCE);
System.out.println("feeding motor speed is: " + feederMotor.getMotorOutputPercent());

}
Expand Down

0 comments on commit a80a9ee

Please sign in to comment.