Files
2022NoWayHome/src/main/java/frc4388/robot/commands/ExtenderIntakeGroup.java
T

30 lines
1.1 KiB
Java
Raw Normal View History

2022-03-14 15:16:21 -06:00
// 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 frc4388.robot.commands;
import edu.wpi.first.wpilibj2.command.ParallelRaceGroup;
import frc4388.robot.subsystems.Extender;
import frc4388.robot.subsystems.Intake;
// NOTE: Consider using this command inline, rather than writing a subclass. For more
// information, see:
// https://docs.wpilib.org/en/stable/docs/software/commandbased/convenience-features.html
public class ExtenderIntakeGroup extends ParallelRaceGroup {
public static int direction = 1; // assume extender starts retracted completely
/** Creates a new RunExtenderAndIntake. */
public ExtenderIntakeGroup(Intake intake, Extender extender) {
// Add your commands in the addCommands() call, e.g.
// addCommands(new FooCommand(), new BarCommand());
ExtenderIntakeGroup.direction = 1;
addCommands(new RunIntakeConditionally(intake), new RunExtender(extender));
}
public static void changeDirection() {
ExtenderIntakeGroup.direction *= -1;
}
}