summaryrefslogtreecommitdiff
path: root/src/main/java/frc/robot/subsystems/Intake.java
blob: 85cbbf8932ad6e46250d8abd69f0861283fb5480 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package frc.robot.subsystems;

import org.littletonrobotics.junction.Logger;
import com.revrobotics.CANSparkMax;

import edu.wpi.first.wpilibj2.command.SubsystemBase;
import frc.robot.Constants;

public class Intake extends SubsystemBase 
{
    private final CANSparkMax m_intakeT = Constants.intakeT;
    private final CANSparkMax m_intakeD = Constants.intakeD;

    public Intake() { }

    public void atPercentage(double perc) 
    {
        atPercentage(perc, perc); 
    }

    public void atPercentage(double upPerc, double downPerc) 
    {
        m_intakeT.set(upPerc);
        m_intakeD.set(downPerc);
    }

    @Override
    public void periodic()
    {
        Logger.recordOutput(getName() + "/speedT", m_intakeT.getEncoder().getVelocity());
        Logger.recordOutput(getName() + "/speedD", m_intakeD.getEncoder().getVelocity());

    }
}