mirror of
https://github.com/Team4388/To-Shoot-TShirt.git
synced 2026-06-09 00:38:05 -06:00
USB edition Digital Deluxe
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
/* 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.
|
||||
@@ -6,11 +5,12 @@
|
||||
package frc4388.robot.subsystems;
|
||||
|
||||
import edu.wpi.first.wpilibj2.command.SubsystemBase;
|
||||
|
||||
import frc4388.utility.DPrint;
|
||||
import frc4388.robot.Constants.DebugConstants;
|
||||
import edu.wpi.first.wbilib.Solnoid;
|
||||
|
||||
DPrint DPrinter = new DPrint(DebugConstants.TYPE_INFO)
|
||||
public class ShootTube extends SubsystemBase {
|
||||
/** Creates a new ShootTube. */
|
||||
Solenoid[] m_solenoids;
|
||||
int m_cycleCount = 0;
|
||||
int m_maxCount;
|
||||
@@ -19,39 +19,52 @@ public class ShootTube extends SubsystemBase {
|
||||
m_maxCount = m_solenoids.length;
|
||||
}
|
||||
/*
|
||||
Functions designed for the DPAD left and right buttions to
|
||||
Cycle the tube to be shooting out of
|
||||
Functions designed for the Left and Right Bumpers to
|
||||
Cycle the tube slected manualy.
|
||||
*/
|
||||
public void CycleUp() {
|
||||
m_cycleCount++;
|
||||
if (m_cycleCount >= m_maxCount || m_cycleCount < 0) {
|
||||
m_cycleCount = 0;
|
||||
}
|
||||
}
|
||||
DPrinter.println("Current CycleCount: "+m_cycleCount)
|
||||
}
|
||||
public void CycleDown() {
|
||||
m_cycleCount--;
|
||||
if (m_cycleCount >= m_maxCount || m_cycleCount < 0) {
|
||||
m_cycleCount = 0;
|
||||
}
|
||||
}
|
||||
DPrinter.println("Current CycleCount: "+m_cycleCount)
|
||||
}
|
||||
/*
|
||||
Normal Shoot Tube and Normal Shoot Tube Index Functions
|
||||
*/
|
||||
/* Function "ShootTubeSet" cycles up automaticly */
|
||||
public void ShootTubeSet(Boolean arg) {
|
||||
m_solenoids[CycleCount].set(arg);
|
||||
/* If closing valve:
|
||||
Increse the CycleCount by one,
|
||||
if the CycleCount >= the length of the array OR CycleCount < 0:
|
||||
set CycleCount to 0 */
|
||||
if (arg == false) {
|
||||
CycleCount++;
|
||||
m_cycleCount++;
|
||||
if (m_cycleCount >= m_maxCount || m_cycleCount < 0) {
|
||||
m_cycleCount = 0;
|
||||
}
|
||||
}
|
||||
DPrinter.println("Current CycleCount: "+m_cycleCount)
|
||||
}
|
||||
/* Function "ShootTubeIndex" won't cycle up automaticly */
|
||||
/* Not used, yet Useful */
|
||||
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
|
||||
in the array in enumeration
|
||||
can't do m_solenoids[1].set(true), m_solenoids[2].set(true) due to
|
||||
the fact that the object needs to be variable in the length of the array
|
||||
Designed for the X buttion
|
||||
*/
|
||||
public void ShootTubeALL(Boolean arg) {
|
||||
for (Solenoid x : m_solenoids) {
|
||||
|
||||
Reference in New Issue
Block a user