Package edu.wpi.first.wpilibj
Class PneumaticHub
java.lang.Object
edu.wpi.first.wpilibj.PneumaticHub
- All Implemented Interfaces:
PneumaticsBase
,AutoCloseable
public class PneumaticHub extends Object implements PneumaticsBase
Module class for controlling a REV Robotics Pneumatic Hub.
-
Constructor Summary
Constructors Constructor Description PneumaticHub()
Constructs a PneumaticHub with the default id (1).PneumaticHub(int module)
Constructs a PneumaticHub. -
Method Summary
Modifier and Type Method Description int
checkAndReserveSolenoids(int mask)
Check to see if the masked solenoids can be reserved, and if not reserve them.boolean
checkSolenoidChannel(int channel)
Check if a solenoid channel is valid.void
clearStickyFaults()
void
close()
void
disableCompressor()
void
enableCompressorAnalog(double minPressure, double maxPressure)
void
enableCompressorDigital()
void
enableCompressorHybrid(double minPressure, double maxPressure)
void
fireOneShot(int index)
Fire a single solenoid shot.double
get5VRegulatedVoltage()
double
getAnalogVoltage(int channel)
boolean
getCompressor()
CompressorConfigType
getCompressorConfigType()
double
getCompressorCurrent()
REVPHFaults
getFaults()
double
getInputVoltage()
int
getModuleNumber()
Get module number for this module.double
getPressure(int channel)
boolean
getPressureSwitch()
int
getSolenoidDisabledList()
Get the disabled solenoids.int
getSolenoids()
Gets solenoid values.double
getSolenoidsTotalCurrent()
double
getSolenoidsVoltage()
REVPHStickyFaults
getStickyFaults()
REVPHVersion
getVersion()
Compressor
makeCompressor()
DoubleSolenoid
makeDoubleSolenoid(int forwardChannel, int reverseChannel)
Solenoid
makeSolenoid(int channel)
boolean
reserveCompressor()
void
setOneShotDuration(int index, int durMs)
Set the duration for a single solenoid shot.void
setSolenoids(int mask, int values)
Sets solenoids on a pneumatics module.void
unreserveCompressor()
void
unreserveSolenoids(int mask)
Unreserve the masked solenoids.
-
Constructor Details
-
PneumaticHub
public PneumaticHub()Constructs a PneumaticHub with the default id (1). -
PneumaticHub
Constructs a PneumaticHub.- Parameters:
module
- module number to construct
-
-
Method Details
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfacePneumaticsBase
-
getCompressor
- Specified by:
getCompressor
in interfacePneumaticsBase
-
getCompressorConfigType
- Specified by:
getCompressorConfigType
in interfacePneumaticsBase
-
getPressureSwitch
- Specified by:
getPressureSwitch
in interfacePneumaticsBase
-
getCompressorCurrent
- Specified by:
getCompressorCurrent
in interfacePneumaticsBase
-
setSolenoids
Description copied from interface:PneumaticsBase
Sets solenoids on a pneumatics module.- Specified by:
setSolenoids
in interfacePneumaticsBase
- Parameters:
mask
- maskvalues
- values
-
getSolenoids
Description copied from interface:PneumaticsBase
Gets solenoid values.- Specified by:
getSolenoids
in interfacePneumaticsBase
- Returns:
- values
-
getModuleNumber
Description copied from interface:PneumaticsBase
Get module number for this module.- Specified by:
getModuleNumber
in interfacePneumaticsBase
- Returns:
- module number
-
fireOneShot
Description copied from interface:PneumaticsBase
Fire a single solenoid shot.- Specified by:
fireOneShot
in interfacePneumaticsBase
- Parameters:
index
- solenoid index
-
setOneShotDuration
Description copied from interface:PneumaticsBase
Set the duration for a single solenoid shot.- Specified by:
setOneShotDuration
in interfacePneumaticsBase
- Parameters:
index
- solenoid indexdurMs
- shot duration
-
checkSolenoidChannel
Description copied from interface:PneumaticsBase
Check if a solenoid channel is valid.- Specified by:
checkSolenoidChannel
in interfacePneumaticsBase
- Parameters:
channel
- Channel to check- Returns:
- True if channel exists
-
checkAndReserveSolenoids
Description copied from interface:PneumaticsBase
Check to see if the masked solenoids can be reserved, and if not reserve them.- Specified by:
checkAndReserveSolenoids
in interfacePneumaticsBase
- Parameters:
mask
- The solenoid mask to reserve- Returns:
- 0 if successful, mask of solenoids that couldn't be allocated otherwise
-
unreserveSolenoids
Description copied from interface:PneumaticsBase
Unreserve the masked solenoids.- Specified by:
unreserveSolenoids
in interfacePneumaticsBase
- Parameters:
mask
- The solenoid mask to unreserve
-
makeSolenoid
- Specified by:
makeSolenoid
in interfacePneumaticsBase
-
makeDoubleSolenoid
- Specified by:
makeDoubleSolenoid
in interfacePneumaticsBase
-
makeCompressor
- Specified by:
makeCompressor
in interfacePneumaticsBase
-
reserveCompressor
- Specified by:
reserveCompressor
in interfacePneumaticsBase
-
unreserveCompressor
- Specified by:
unreserveCompressor
in interfacePneumaticsBase
-
getSolenoidDisabledList
Description copied from interface:PneumaticsBase
Get the disabled solenoids.- Specified by:
getSolenoidDisabledList
in interfacePneumaticsBase
- Returns:
- disabled list
-
disableCompressor
- Specified by:
disableCompressor
in interfacePneumaticsBase
-
enableCompressorDigital
- Specified by:
enableCompressorDigital
in interfacePneumaticsBase
-
enableCompressorAnalog
- Specified by:
enableCompressorAnalog
in interfacePneumaticsBase
-
enableCompressorHybrid
- Specified by:
enableCompressorHybrid
in interfacePneumaticsBase
-
getAnalogVoltage
- Specified by:
getAnalogVoltage
in interfacePneumaticsBase
-
getPressure
- Specified by:
getPressure
in interfacePneumaticsBase
-
clearStickyFaults
-
getVersion
-
getFaults
-
getStickyFaults
-
getInputVoltage
-
get5VRegulatedVoltage
-
getSolenoidsTotalCurrent
-
getSolenoidsVoltage
-