mirror of
https://github.com/Team4388/2022NoWayHome.git
synced 2026-06-09 08:48:07 -06:00
Intake fixes
This commit is contained in:
@@ -3,6 +3,7 @@ package frc4388.robot.subsystems;
|
||||
import edu.wpi.first.wpilibj.motorcontrol.Spark;
|
||||
import edu.wpi.first.wpilibj2.command.SubsystemBase;
|
||||
import frc4388.robot.Constants;
|
||||
import frc4388.robot.Constants.SerializerConstants;
|
||||
import edu.wpi.first.wpilibj.DigitalInput;
|
||||
import com.revrobotics.CANSparkMax;
|
||||
|
||||
@@ -14,15 +15,16 @@ public class Serializer extends SubsystemBase{
|
||||
|
||||
public Serializer(CANSparkMax serializerBelt, /*CANSparkMax serializerShooterBelt,*/ DigitalInput serializerBeam) {
|
||||
m_serializerBelt = serializerBelt;
|
||||
// m_serializerShooterBelt = serializerShooterBelt;
|
||||
m_serializerBeam = serializerBeam;
|
||||
|
||||
serializerState = false;
|
||||
setSerializerState(serializerState);
|
||||
m_serializerBelt.set(0);
|
||||
// m_serializerShooterBelt.set(0);
|
||||
|
||||
}
|
||||
|
||||
public void setSerializer(double input){
|
||||
m_serializerBelt.set(input);
|
||||
}
|
||||
/**
|
||||
* Gets The State Of The Beam
|
||||
* @return The State Of The Beam
|
||||
@@ -30,40 +32,16 @@ public class Serializer extends SubsystemBase{
|
||||
public boolean getBeam() {
|
||||
return m_serializerBeam.get();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets The Serializer State With The Beam
|
||||
* @param state Your State Of The Button
|
||||
* @param beambroken The State of the Beam Senser
|
||||
*/
|
||||
public void setSerializerStateWithBeam(boolean state, boolean beambroken) {
|
||||
boolean total = state || beambroken;
|
||||
setSerializerState(total);
|
||||
public void setSerializerStateWithBeam() {
|
||||
if (m_serializerBeam.get()) setSerializer(0.0);
|
||||
else setSerializer(SerializerConstants.SERIALIZER_BELT_SPEED);
|
||||
}
|
||||
/**
|
||||
* Sets The Serializer State With The Beam
|
||||
* @param state Your State Of The Button
|
||||
*/
|
||||
public void setSerializerState(boolean state) {
|
||||
setSerializerBeltState(state);
|
||||
// setSerializerShooterBeltState(state);
|
||||
serializerState = state;
|
||||
}
|
||||
/**
|
||||
* Sets the Serializer Belt State
|
||||
* @param state Your State Of The Button
|
||||
*/
|
||||
public void setSerializerBeltState(boolean state) {
|
||||
double serializerBeltSpeed = state ? Constants.SerializerConstants.SERIALIZER_BELT_SPEED : 0.d;
|
||||
m_serializerBelt.set(serializerBeltSpeed);
|
||||
}
|
||||
// /**
|
||||
// * Sets the Shooter Belt State
|
||||
// * @param state Your State Of The Button
|
||||
// */
|
||||
// public void setSerializerShooterBeltState(boolean state) {
|
||||
// double serializerShooterBeltSpeed = state ? Constants.SerializerConstants.SERIALIZER_SHOOTER_BELT_SPEED : 0.d;
|
||||
// m_serializerShooterBelt.set(serializerShooterBeltSpeed);
|
||||
// }
|
||||
|
||||
/**
|
||||
* Gets the Serializer State
|
||||
|
||||
Reference in New Issue
Block a user