mirror of
https://github.com/Team4388/To-Shoot-TShirt.git
synced 2026-06-09 00:38:05 -06:00
USB edition
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
/* Dumb Command Version, Smart Subsytem Version */
|
||||
// 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.
|
||||
@@ -9,18 +10,57 @@ import edu.wpi.first.wpilibj2.command.SubsystemBase;
|
||||
import edu.wpi.first.wbilib.Solnoid;
|
||||
|
||||
public class ShootTube extends SubsystemBase {
|
||||
/** Creates a new ShootTube. */
|
||||
Solenoid m_solenoids;
|
||||
public ShootTube(Solenoid[] solenoids) {
|
||||
m_solenoids = solenoids;
|
||||
}
|
||||
|
||||
public void ShootTubeSet(boolean arg, Solenoid tube) {
|
||||
tube.set(arg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void periodic() {
|
||||
// This method will be called once per scheduler run
|
||||
}
|
||||
}
|
||||
/** Creates a new ShootTube. */
|
||||
Solenoid[] m_solenoids;
|
||||
int m_cycleCount = 0;
|
||||
int m_maxCount;
|
||||
public ShootTube(Solenoid[] solenoids) {
|
||||
m_solenoids = solenoidArray;
|
||||
m_maxCount = m_solenoids.length;
|
||||
}
|
||||
/*
|
||||
Functions designed for the DPAD left and right buttions to
|
||||
Cycle the tube to be shooting out of
|
||||
*/
|
||||
public void CycleUp() {
|
||||
m_cycleCount++;
|
||||
if (m_cycleCount >= m_maxCount || m_cycleCount < 0) {
|
||||
m_cycleCount = 0;
|
||||
}
|
||||
}
|
||||
public void CycleDown() {
|
||||
m_cycleCount--;
|
||||
if (m_cycleCount >= m_maxCount || m_cycleCount < 0) {
|
||||
m_cycleCount = 0;
|
||||
}
|
||||
}
|
||||
/*
|
||||
Normal Shoot Tube and Normal Shoot Tube Index Functions
|
||||
*/
|
||||
public void ShootTubeSet(Boolean arg) {
|
||||
m_solenoids[CycleCount].set(arg);
|
||||
if (arg == false) {
|
||||
CycleCount++;
|
||||
if (m_cycleCount >= m_maxCount || m_cycleCount < 0) {
|
||||
m_cycleCount = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
public void ShootTubeIndex(Boolean arg, int i) {
|
||||
m_solenoids[i].set(arg);
|
||||
}
|
||||
/*
|
||||
Just Normal Shoot Tube But it Shoots all of the tubes
|
||||
Designed for DPAD Down
|
||||
*/
|
||||
public void ShootTubeALL(Boolean arg) {
|
||||
for (Solenoid x : m_solenoids) {
|
||||
x.set(arg);
|
||||
}
|
||||
m_cycleCount = 0;
|
||||
}
|
||||
@Override
|
||||
public void periodic() {
|
||||
// This method will be called once per scheduler run
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user