Package edu.wpi.first.wpilibj
Interface PneumaticsBase
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
PneumaticHub
,PneumaticsControlModule
public interface PneumaticsBase extends AutoCloseable
-
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
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
getAnalogVoltage(int channel)
boolean
getCompressor()
CompressorConfigType
getCompressorConfigType()
double
getCompressorCurrent()
static int
getDefaultForType(PneumaticsModuleType type)
For internal use to get the default for a specific type.static PneumaticsBase
getForType(int module, PneumaticsModuleType type)
For internal use to get a module for a specific type.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.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.
-
Method Details
-
getForType
For internal use to get a module for a specific type.- Parameters:
module
- module numbertype
- module type- Returns:
- module
-
getDefaultForType
For internal use to get the default for a specific type.- Parameters:
type
- module type- Returns:
- module default
-
setSolenoids
Sets solenoids on a pneumatics module.- Parameters:
mask
- maskvalues
- values
-
getSolenoids
int getSolenoids()Gets solenoid values.- Returns:
- values
-
getModuleNumber
int getModuleNumber()Get module number for this module.- Returns:
- module number
-
getSolenoidDisabledList
int getSolenoidDisabledList()Get the disabled solenoids.- Returns:
- disabled list
-
fireOneShot
Fire a single solenoid shot.- Parameters:
index
- solenoid index
-
setOneShotDuration
Set the duration for a single solenoid shot.- Parameters:
index
- solenoid indexdurMs
- shot duration
-
getCompressor
boolean getCompressor() -
getPressureSwitch
boolean getPressureSwitch() -
getCompressorCurrent
double getCompressorCurrent() -
disableCompressor
void disableCompressor() -
enableCompressorDigital
void enableCompressorDigital() -
enableCompressorAnalog
-
enableCompressorHybrid
-
getAnalogVoltage
-
getPressure
-
getCompressorConfigType
-
checkSolenoidChannel
Check if a solenoid channel is valid.- Parameters:
channel
- Channel to check- Returns:
- True if channel exists
-
checkAndReserveSolenoids
Check to see if the masked solenoids can be reserved, and if not reserve them.- Parameters:
mask
- The solenoid mask to reserve- Returns:
- 0 if successful, mask of solenoids that couldn't be allocated otherwise
-
unreserveSolenoids
Unreserve the masked solenoids.- Parameters:
mask
- The solenoid mask to unreserve
-
reserveCompressor
boolean reserveCompressor() -
unreserveCompressor
void unreserveCompressor() -
close
void close()- Specified by:
close
in interfaceAutoCloseable
-
makeSolenoid
-
makeDoubleSolenoid
-
makeCompressor
-