FRC9015 / Crescendo

Other
4 stars 0 forks source link

Declare intake subsystem in robot code #7

Closed moyales closed 9 months ago

moyales commented 9 months ago

For each subsystem we will have in our robot, we require that subsystem to be declared in our code, namely under the subsystems/ folder. Below is an example for what a "blank" subsystem looks like. Please refer to this page for more information about subsystems.

package frc.robot.subsystems;

import edu.wpi.first.wpilibj2.command.SubsystemBase;

public class Intake extends SubsystemBase {

    // Declare private motor variable(s) here
    private static Intake intake;

    public Intake() {

    }

    public void init() {
    //add motor initialization
    }

    /**
     * 
     */
    @Override
    public void periodic() {
      // This method will be called once per scheduler run

    }

    /**
     * 
     */
    @Override
    public void simulationPeriodic() {
    // This method will be called once per scheduler run during simulation
    }

    /**
     * 
     */
    public void intake(){
        //Motor.setpercentOutput(speed);
    }

    /**
     * 
     */
    public void outtake(){
        //Motor.setpercentOutput(-speed);
    }

    public Intake getInstance(){
        if (intake==null){
            intake = new Intake();
        }
        return intake;
    }
}