mirror of
https://github.com/Team4388/2022NoWayHome.git
synced 2026-06-09 00:38:05 -06:00
S T O R A G E
This commit is contained in:
@@ -81,6 +81,11 @@ public final class Constants {
|
||||
public static final int INTAKE_MOTOR = 3;
|
||||
public static final int EXTENDER_MOTOR = 6;
|
||||
}
|
||||
public static final class StorageConstants {
|
||||
public static final int STORAGE_CAN_ID = -1; //TODO
|
||||
public static final int BEAM_SENSOR_SHOOTER = -1; //TODO
|
||||
public static final int BEAM_SENSOR_INTAKE = -1; //TODO
|
||||
}
|
||||
public static final class LEDConstants {
|
||||
public static final int LED_SPARK_ID = 0;
|
||||
|
||||
|
||||
@@ -32,17 +32,14 @@ public class Serializer extends SubsystemBase{
|
||||
setSerializerState(total);
|
||||
}
|
||||
public void setSerializerState(boolean state) {
|
||||
System.out.println(state);
|
||||
setSerializerBeltState(state);
|
||||
setSerializerShooterBeltState(state);
|
||||
serializerState = state;
|
||||
}
|
||||
|
||||
public void setSerializerBeltState(boolean state) {
|
||||
System.out.println("oi");
|
||||
double serializerBeltSpeed = state ? Constants.SerializerConstants.SERIALIZER_BELT_SPEED : 0.d;
|
||||
m_serializerBelt.set(serializerBeltSpeed);
|
||||
System.out.println("oi2");
|
||||
}
|
||||
|
||||
public void setSerializerShooterBeltState(boolean state) {
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
package frc4388.robot.subsystems;
|
||||
|
||||
import edu.wpi.first.wpilibj2.command.SubsystemBase;
|
||||
import com.revrobotics.CANSparkMax;
|
||||
import com.revrobotics.CANSparkMaxLowLevel.MotorType;
|
||||
import edu.wpi.first.wpilibj.DigitalInput;
|
||||
import frc4388.robot.Constants.StorageConstants;
|
||||
|
||||
public class Storage extends SubsystemBase {
|
||||
public CANSparkMax m_storageMotor = new CANSparkMax(StorageConstants.STORAGE_CAN_ID, MotorType.kBrushless);
|
||||
private DigitalInput m_beamShooter = new DigitalInput(StorageConstants.BEAM_SENSOR_SHOOTER);
|
||||
private DigitalInput m_beamIntake = new DigitalInput(StorageConstants.BEAM_SENSOR_INTAKE);
|
||||
|
||||
/** Creates a new Storage. */
|
||||
public Storage() {
|
||||
|
||||
}
|
||||
|
||||
public void runStorage(double input) {
|
||||
m_storageMotor.set(input);
|
||||
}
|
||||
|
||||
public boolean getBeamShooter(){
|
||||
return m_beamShooter.get();
|
||||
}
|
||||
|
||||
public boolean getBeamIntake(){
|
||||
return m_beamIntake.get();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void periodic() {
|
||||
// This method will be called once per scheduler run
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user