-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into CollectNoteTesting
- Loading branch information
Showing
5 changed files
with
41 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,30 @@ | ||
package frc.robot.subsystems; | ||
|
||
import com.revrobotics.CANSparkMax; | ||
import com.revrobotics.RelativeEncoder; | ||
import com.revrobotics.SparkPIDController; | ||
import com.revrobotics.SparkRelativeEncoder; | ||
import com.revrobotics.CANSparkBase.ControlType; | ||
import com.revrobotics.CANSparkBase.IdleMode; | ||
import com.revrobotics.CANSparkLowLevel.MotorType; | ||
import edu.wpi.first.wpilibj2.command.SubsystemBase; | ||
import frc.robot.settings.Constants; | ||
import com.revrobotics.CANSparkLowLevel.MotorType; | ||
import edu.wpi.first.wpilibj2.command.SubsystemBase; | ||
import frc.robot.settings.Constants.IndexerConstants; | ||
|
||
public class IndexerSubsystem extends SubsystemBase{ | ||
CANSparkMax holder1; | ||
CANSparkMax holder2; | ||
CANSparkMax feeder1; | ||
CANSparkMax feeder2; | ||
boolean isHolding; | ||
public IndexerSubsystem(){ | ||
CANSparkMax holder1 = new CANSparkMax(IndexerConstants.HOLDER_1_MOTOR, MotorType.kBrushless); | ||
CANSparkMax holder2 = new CANSparkMax(IndexerConstants.HOLDER_2_MOTOR, MotorType.kBrushless); | ||
CANSparkMax feeder1 = new CANSparkMax(IndexerConstants.FEEDER_1_MOTOR, MotorType.kBrushless); | ||
CANSparkMax feeder2 = new CANSparkMax(IndexerConstants.FEEDER_2_MOTOR, MotorType.kBrushless); | ||
//sensor sensorThingy = new ???; | ||
boolean isHolding = false; | ||
feeder2.follow(feeder1); | ||
feeder2.setInverted(true); | ||
holder2.follow(holder1); | ||
holder2.setInverted(true); | ||
holder1.setIdleMode(IdleMode.kBrake); | ||
holder2.setIdleMode(IdleMode.kBrake); | ||
feeder1.setIdleMode(IdleMode.kBrake); | ||
feeder2.setIdleMode(IdleMode.kBrake); | ||
public class IndexerSubsystem extends SubsystemBase { | ||
CANSparkMax m_IndexerMotor; | ||
|
||
public IndexerSubsystem() { | ||
m_IndexerMotor = new CANSparkMax(IndexerConstants.INDEXER_MOTOR, MotorType.kBrushless); | ||
} | ||
|
||
public double getInchesFromSensor() { | ||
return 0; | ||
} | ||
public void feederFeed(double generalSpeed){ | ||
feeder1.set(generalSpeed); | ||
} | ||
public void feederOff(){ | ||
feeder1.set(0); | ||
} | ||
public void holderRetrieve(double generalSpeed){ | ||
holder1.set(generalSpeed); | ||
|
||
public void on() { | ||
m_IndexerMotor.set(IndexerConstants.INDEXER_SPEED); | ||
} | ||
public void holderOff(){ | ||
holder1.set(0); | ||
|
||
public void off() { | ||
m_IndexerMotor.set(0); | ||
} | ||
public void allOff(){ | ||
feeder1.set(0); | ||
holder1.set(0); | ||
|
||
public void reverse() { | ||
m_IndexerMotor.set(-IndexerConstants.INDEXER_SPEED); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters