From 5ffa28596ced83cbdaeb04eaece20f208771b8c2 Mon Sep 17 00:00:00 2001 From: Antoine PerreaultE Date: Tue, 28 Jan 2025 18:24:21 -0500 Subject: [PATCH] aspire --- src/main/java/frc/robot/subsystems/Pince.java | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 src/main/java/frc/robot/subsystems/Pince.java diff --git a/src/main/java/frc/robot/subsystems/Pince.java b/src/main/java/frc/robot/subsystems/Pince.java new file mode 100644 index 0000000..e5219be --- /dev/null +++ b/src/main/java/frc/robot/subsystems/Pince.java @@ -0,0 +1,44 @@ +// 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 frc.robot.subsystems; + +import com.revrobotics.spark.SparkLowLevel.MotorType; +import com.revrobotics.spark.SparkMax; + +import edu.wpi.first.wpilibj.DigitalInput; +import edu.wpi.first.wpilibj2.command.SubsystemBase; + +public class Pince extends SubsystemBase { + /** Creates a new Pince. */ + public Pince() {} + final SparkMax coral = new SparkMax(0, MotorType.kBrushless); + final SparkMax pivoti = new SparkMax(0, MotorType.kBrushless); + final SparkMax algue1 = new SparkMax(0, MotorType.kBrushless); + final SparkMax algue2 = new SparkMax(0, MotorType.kBrushless); + final DigitalInput limit6 = new DigitalInput(0); + public void aspirecoral(double vitesse){ + coral.set(vitesse); + } +public void pivote(double vitesse){ + pivoti.set(vitesse); +} +public void aspirealgue(double vitesse){ + algue2.set(vitesse); + algue1.set(-vitesse); +} +public double encodeurpivot(){ + return pivoti.getEncoder().getPosition(); +} +public void pisotion(){ + limit6.get(); +} +public void reset(){ + pivoti.getEncoder().setPosition(0); +} + @Override + public void periodic() { + // This method will be called once per scheduler run + } +}