Skip to content

Commit

Permalink
Add dcoumentation for setTargetPercent method in Neo.java
Browse files Browse the repository at this point in the history
  • Loading branch information
derp00monsta committed Jan 27, 2024
1 parent 61c9323 commit 39c6845
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/frc/robot/subsystems/Shooter.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public Command shoot(Pose2d position, boolean shootingAtSpeaker) {
SpeedAnglePair pair = calculateSpeed(position, shootingAtSpeaker);
return runOnce(() -> motorLeft.setTargetPercent(1));
}
//TODO: change target velocity to target percent

public Command stop() {
return runOnce(() -> motorLeft.setTargetPercent(0));
}
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/frc/robot/util/Neo.java
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,16 @@ public void setTargetPosition(double position) {
setTargetPosition(position, 0, 0);
}

// Creates method to set the target percent of the volatge for the NEO.
public void setTargetPercent(double percent) {
setTargetPercent(percent, 0);
}

/**
* Sets the target percent of voltage for the NEO.
* @param percent Percent of battery voltage
* @param slot The PID slot.
*/
public void setTargetPercent(double percent, int slot) {
percent *= reversedMultiplier;
if (percent == 0) {
Expand Down

0 comments on commit 39c6845

Please sign in to comment.