HP laptop test and added with intake code (Forgot to save before last commit)
This commit is contained in:
parent
2fd5e8719c
commit
f466c88ccb
@ -1,8 +1,8 @@
|
|||||||
package frc.robot.constants;
|
package frc.robot.constants;
|
||||||
|
|
||||||
public class DrivetrainConstants {
|
public class DrivetrainConstants {
|
||||||
public static final int kLeftFrontID = 0;
|
public static final int kLeftFrontID = 1;
|
||||||
public static final int kLeftRearID = 1;
|
public static final int kLeftRearID = 2;
|
||||||
public static final int kRightFrontID = 2;
|
public static final int kRightFrontID = 3;
|
||||||
public static final int kRightRearID = 3;
|
public static final int kRightRearID = 4;
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package frc.robot.constants;
|
package frc.robot.constants;
|
||||||
|
|
||||||
public class ShooterConstants {
|
public class ShooterConstants {
|
||||||
public static final int K1MotorPWM = 0;
|
public static final int K1MotorPWM = 5;
|
||||||
public static final int K2MotorPWM = 0;
|
public static final int K2MotorPWM = 6;
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,5 @@
|
|||||||
|
package frc.robot.constants;
|
||||||
|
|
||||||
|
public class intakeConstants {
|
||||||
|
public static final int K1MotorPWM = 5;
|
||||||
|
}
|
@ -0,0 +1,30 @@
|
|||||||
|
package frc.robot.subsystems;
|
||||||
|
|
||||||
|
import java.util.function.DoubleSupplier;
|
||||||
|
|
||||||
|
import com.ctre.phoenix.motorcontrol.can.WPI_VictorSPX;
|
||||||
|
|
||||||
|
import edu.wpi.first.wpilibj2.command.Command;
|
||||||
|
import edu.wpi.first.wpilibj2.command.SubsystemBase;
|
||||||
|
import frc.robot.constants.intakeConstants;
|
||||||
|
|
||||||
|
public class Intake extends SubsystemBase{
|
||||||
|
private WPI_VictorSPX motor1;
|
||||||
|
|
||||||
|
|
||||||
|
public Intake() {
|
||||||
|
motor1 = new WPI_VictorSPX(intakeConstants.K1MotorPWM);
|
||||||
|
|
||||||
|
}
|
||||||
|
public Command setSpeed(DoubleSupplier speed) {
|
||||||
|
//sets the motors speed
|
||||||
|
return run(() -> {
|
||||||
|
motor1.set(speed.getAsDouble());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
public Command stop() {
|
||||||
|
//stops the motors
|
||||||
|
return setSpeed(() -> 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user