Files
pratique-2025/src/main/java/frc/robot/Subsystems/Accumulateur.java
2024-11-13 18:56:31 -05:00

54 lines
1.7 KiB
Java

// 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 edu.wpi.first.networktables.GenericEntry;
import edu.wpi.first.wpilibj.DigitalInput;
import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard;
import edu.wpi.first.wpilibj.shuffleboard.ShuffleboardTab;
import edu.wpi.first.wpilibj2.command.SubsystemBase;
import com.ctre.phoenix.motorcontrol.can.WPI_TalonSRX;
public class Accumulateur extends SubsystemBase {
/** Creates a new Accumulateur. */
public Accumulateur() {dashboard.addBoolean("photocell", this::photocell).withSize(1, 1).withPosition(0, 1);
dashboard.addBoolean("photocell2", this::photocell).withSize(1, 1).withPosition(0, 1);
}
ShuffleboardTab dashboard = Shuffleboard.getTab("dashboard");
private GenericEntry vitesse =
dashboard.add("vitesseacc", 0.1)
.withSize(1, 1)
.withPosition(0, 4)
.getEntry();
final WPI_TalonSRX strap = new WPI_TalonSRX(0);
final WPI_TalonSRX roueRouge = new WPI_TalonSRX(10);
final DigitalInput photocell = new DigitalInput(20);
final DigitalInput photocell2 = new DigitalInput(21);
public void encodeur(){
}
public boolean photocell(){
return photocell.get();
}
public boolean photocell2(){
return photocell2.get();
}
public void desaccumule(double vitesse){
strap.set(vitesse);
}
public void Petitlanceur(double vitesse){
roueRouge.set(vitesse);
}
public void desaccumule(){
desaccumule(vitesse.getDouble(0.9));
}
@Override
public void periodic() {
// This method will be called once per scheduler run
}
}