PneumaticHub
- class wpilib.PneumaticHub(*args, **kwargs)
Bases:
PneumaticsBaseModule class for controlling a REV Robotics Pneumatic Hub.
Overloaded function.
__init__(self: wpilib._wpilib.PneumaticHub, busId: typing.SupportsInt | typing.SupportsIndex) -> None
Constructs a PneumaticHub with the default ID (1).
- Parameters:
busId – The bus ID.
__init__(self: wpilib._wpilib.PneumaticHub, busId: typing.SupportsInt | typing.SupportsIndex, module: typing.SupportsInt | typing.SupportsIndex) -> None
Constructs a PneumaticHub.
- Parameters:
busId – The bus ID.
module – module number to construct
- class Faults
Bases:
pybind11_objectFaults for a REV PH. These faults are only active while the condition is active.
- property brownout
The input voltage is below the minimum voltage.
- property canWarning
A warning was raised by the device’s CAN controller.
- property channel0Fault
Fault on channel 0.
- property channel10Fault
Fault on channel 10.
- property channel11Fault
Fault on channel 11.
- property channel12Fault
Fault on channel 12.
- property channel13Fault
Fault on channel 13.
- property channel14Fault
Fault on channel 14.
- property channel15Fault
Fault on channel 15.
- property channel1Fault
Fault on channel 1.
- property channel2Fault
Fault on channel 2.
- property channel3Fault
Fault on channel 3.
- property channel4Fault
Fault on channel 4.
- property channel5Fault
Fault on channel 5.
- property channel6Fault
Fault on channel 6.
- property channel7Fault
Fault on channel 7.
- property channel8Fault
Fault on channel 8.
- property channel9Fault
Fault on channel 9.
- property compressorOpen
The compressor output has an open circuit.
- property compressorOverCurrent
An overcurrent event occurred on the compressor output.
- getChannelFault(channel: SupportsInt | SupportsIndex) bool
Gets whether there is a fault at the specified channel.
- Parameters:
channel – Channel to check for faults.
- Returns:
True if a a fault exists at the channel, otherwise false. @throws A ChannelIndexOutOfRange error if the provided channel is outside of the range supported by the hardware.
- property hardwareFault
The hardware on the device has malfunctioned.
- property solenoidOverCurrent
An overcurrent event occurred on a solenoid output.
- class StickyFaults
Bases:
pybind11_objectSticky faults for a REV PH. These faults will remain active until they are reset by the user.
- property brownout
The input voltage is below the minimum voltage.
- property canBusOff
The device’s CAN controller experienced a “Bus Off” event.
- property canWarning
A warning was raised by the device’s CAN controller.
- property compressorOpen
The compressor output has an open circuit.
- property compressorOverCurrent
An overcurrent event occurred on the compressor output.
- property firmwareFault
The firmware on the device has malfunctioned.
- property hardwareFault
The hardware on the device has malfunctioned.
- property hasReset
The device has rebooted.
- property solenoidOverCurrent
An overcurrent event occurred on a solenoid output.
- class Version
Bases:
pybind11_objectVersion and device data received from a REV PH.
- checkAndReserveSolenoids(mask: SupportsInt | SupportsIndex) int
- checkSolenoidChannel(channel: SupportsInt | SupportsIndex) bool
- clearStickyFaults() None
Clears the sticky faults.
- disableCompressor() None
Disables the compressor. The compressor will not turn on until EnableCompressorDigital(), EnableCompressorAnalog(), or EnableCompressorHybrid() are called.
- enableCompressorAnalog(minPressure: wpimath.units.pounds_per_square_inch, maxPressure: wpimath.units.pounds_per_square_inch) None
Enables the compressor in analog mode. This mode uses an analog pressure sensor connected to analog channel 0 to cycle the compressor. The compressor will turn on when the pressure drops below
minPressureand will turn off when the pressure reachesmaxPressure.- Parameters:
minPressure – The minimum pressure. The compressor will turn on when the pressure drops below this value. Range 0 - 120 PSI.
maxPressure – The maximum pressure. The compressor will turn off when the pressure reaches this value. Range 0 - 120 PSI. Must be larger then minPressure.
- enableCompressorDigital() None
- enableCompressorHybrid(minPressure: wpimath.units.pounds_per_square_inch, maxPressure: wpimath.units.pounds_per_square_inch) None
Enables the compressor in hybrid mode. This mode uses both a digital pressure switch and an analog pressure sensor connected to analog channel 0 to cycle the compressor.
The compressor will turn on when a both:
The digital pressure switch indicates the system is not full AND
The analog pressure sensor indicates that the pressure in the system is
below the specified minimum pressure.
The compressor will turn off when a either:
The digital pressure switch is disconnected or indicates that the system
is full OR - The pressure detected by the analog sensor is greater than the specified maximum pressure.
- Parameters:
minPressure – The minimum pressure. The compressor will turn on when the pressure drops below this value and the pressure switch indicates that the system is not full. Range 0 - 120 PSI.
maxPressure – The maximum pressure. The compressor will turn off when the pressure reaches this value or the pressure switch is disconnected or indicates that the system is full. Range 0 - 120 PSI. Must be larger then minPressure.
- fireOneShot(index: SupportsInt | SupportsIndex) None
- get5VRegulatedVoltage() wpimath.units.volts
Returns the current voltage of the regulated 5v supply.
- Returns:
The current voltage of the 5v supply.
- getAnalogVoltage(channel: SupportsInt | SupportsIndex) wpimath.units.volts
Returns the raw voltage of the specified analog input channel.
- Parameters:
channel – The analog input channel to read voltage from.
- Returns:
The voltage of the specified analog input channel.
- getCompressor() bool
- getCompressorConfigType() wpilib._wpilib.CompressorConfigType
- getCompressorCurrent() wpimath.units.amperes
- getFaults() wpilib._wpilib.PneumaticHub.Faults
Returns the faults currently active on this device.
- Returns:
The faults.
- getInputVoltage() wpimath.units.volts
Returns the current input voltage for this device.
- Returns:
The input voltage.
- getModuleNumber() int
- getPressure(channel: SupportsInt | SupportsIndex) wpimath.units.pounds_per_square_inch
Returns the pressure read by an analog pressure sensor on the specified analog input channel.
- Parameters:
channel – The analog input channel to read pressure from.
- Returns:
The pressure read by an analog pressure sensor on the specified analog input channel.
- getPressureSwitch() bool
- getSolenoidDisabledList() int
- getSolenoids() int
- getSolenoidsTotalCurrent() wpimath.units.amperes
Returns the total current drawn by all solenoids.
- Returns:
Total current drawn by all solenoids.
- getSolenoidsVoltage() wpimath.units.volts
Returns the current voltage of the solenoid power supply.
- Returns:
The current voltage of the solenoid power supply.
- getStickyFaults() wpilib._wpilib.PneumaticHub.StickyFaults
Returns the sticky faults currently active on this device.
- Returns:
The sticky faults.
- getVersion() wpilib._wpilib.PneumaticHub.Version
Returns the hardware and firmware versions of this device.
- Returns:
The hardware and firmware versions.
- makeCompressor() wpilib._wpilib.Compressor
- makeDoubleSolenoid(forwardChannel: SupportsInt | SupportsIndex, reverseChannel: SupportsInt | SupportsIndex) wpilib._wpilib.DoubleSolenoid
- makeSolenoid(channel: SupportsInt | SupportsIndex) wpilib._wpilib.Solenoid
- reportUsage(device: str, data: str) None
- reserveCompressor() bool
- setOneShotDuration(index: SupportsInt | SupportsIndex, duration: wpimath.units.seconds) None
- setSolenoids(mask: SupportsInt | SupportsIndex, values: SupportsInt | SupportsIndex) None
- unreserveCompressor() None
- unreserveSolenoids(mask: SupportsInt | SupportsIndex) None