Pneumatic Actuator is implemented in the FrcPneumatic class in the Framework Library. It supports one or two channel pneumatic cylinders and provides methods to extend/retract the cylinders with optional delay and duration. Since Pneumatic Actuator is a simple subsystem and only for FRC, there is no need to provide any wrapper class for it. To create a Pneumatic Actuator, you just instantiate the FrcPenumatic class directly.
The following are the most commonly called methods:
...
public FrcPneumatic deployer;
...
public void robotInit()
{
...
if (RobotParams.Preferences.useSubsystems)
{
...
if (RobotParams.Preferences.useDeployer)
{
deployer = new FrcPneumatic(
"Deployer", RobotParams.CANID_PCM, PneumaticsModuleType.REVPH,
RobotParams.PNEUMATIC_DEPLOYER_EXTEND, RobotParams.PNEUMATIC_RETRACT);
// Initialize the deployer position.
deployer.retract();
}
...
}
...
}
public static class Preferences
{
...
// Subsystems
public static boolean useSubsystems = true;
public static boolean useDeployer = true;
...
}
...
//
// Solenoid channels:
// All values below are just an example implementation, you need to change them to fit your subsystem.
//
public static final int PNEUMATIC_DEPLOYER_EXTEND = 0;
public static final int PNEUMATIC_DEPLOYER_RETRACT = 1;
public void updateStatus()
{
...
if (deployer != null)
{
dashboard.displayPrintf(
++lineNum,
"Deployer: extended=" + deployer.isExtended());
}
...
}
protected void operatorControllerButtonEvent(int buttonValue, boolean pressed)
{
...
switch (button)
{
case BUTTON_A:
if (robot.deployer != null)
{
if (pressed)
{
robot.deployer.extend();
}
else
{
robot.deployer.retract();
}
robot.globalTracer.traceInfo(moduleName, ">>>>> DeployerExtended=" + pressed);
}
break;
...
}
...
}