PneumaticHub
- class wpilib.PneumaticHub(*args, **kwargs)
Bases:
PneumaticsBaseModule class for controlling a REV Robotics Pneumatic Hub.
Overloaded function.
__init__(self: wpilib._wpilib.PneumaticHub, bus_id: typing.SupportsInt | typing.SupportsIndex) -> None
Constructs a PneumaticHub with the default ID (1).
- Parameters:
bus_id – The bus ID.
__init__(self: wpilib._wpilib.PneumaticHub, bus_id: typing.SupportsInt | typing.SupportsIndex, module: typing.SupportsInt | typing.SupportsIndex) -> None
Constructs a PneumaticHub.
- Parameters:
bus_id – 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 can_warning
A warning was raised by the device’s CAN controller.
- property channel0_fault
Fault on channel 0.
- property channel10_fault
Fault on channel 10.
- property channel11_fault
Fault on channel 11.
- property channel12_fault
Fault on channel 12.
- property channel13_fault
Fault on channel 13.
- property channel14_fault
Fault on channel 14.
- property channel15_fault
Fault on channel 15.
- property channel1_fault
Fault on channel 1.
- property channel2_fault
Fault on channel 2.
- property channel3_fault
Fault on channel 3.
- property channel4_fault
Fault on channel 4.
- property channel5_fault
Fault on channel 5.
- property channel6_fault
Fault on channel 6.
- property channel7_fault
Fault on channel 7.
- property channel8_fault
Fault on channel 8.
- property channel9_fault
Fault on channel 9.
- property compressor_open
The compressor output has an open circuit.
- property compressor_over_current
An overcurrent event occurred on the compressor output.
- get_channel_fault(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 hardware_fault
The hardware on the device has malfunctioned.
- property solenoid_over_current
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 can_bus_off
The device’s CAN controller experienced a “Bus Off” event.
- property can_warning
A warning was raised by the device’s CAN controller.
- property compressor_open
The compressor output has an open circuit.
- property compressor_over_current
An overcurrent event occurred on the compressor output.
- property firmware_fault
The firmware on the device has malfunctioned.
- property hardware_fault
The hardware on the device has malfunctioned.
- property has_reset
The device has rebooted.
- property solenoid_over_current
An overcurrent event occurred on a solenoid output.
- class Version
Bases:
pybind11_objectVersion and device data received from a REV PH.
- check_and_reserve_solenoids(mask: SupportsInt | SupportsIndex) int
- check_solenoid_channel(channel: SupportsInt | SupportsIndex) bool
- clear_sticky_faults() None
Clears the sticky faults.
- disable_compressor() None
Disables the compressor. The compressor will not turn on until EnableCompressorDigital(), EnableCompressorAnalog(), or EnableCompressorHybrid() are called.
- enable_compressor_analog(min_pressure: wpimath.units.pounds_per_square_inch, max_pressure: 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:
min_pressure – The minimum pressure. The compressor will turn on when the pressure drops below this value. Range 0 - 120 PSI.
max_pressure – The maximum pressure. The compressor will turn off when the pressure reaches this value. Range 0 - 120 PSI. Must be larger then minPressure.
- enable_compressor_digital() None
- enable_compressor_hybrid(min_pressure: wpimath.units.pounds_per_square_inch, max_pressure: 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:
min_pressure – 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.
max_pressure – 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.
- fire_one_shot(index: SupportsInt | SupportsIndex) None
- get_5v_regulated_voltage() wpimath.units.volts
Returns the current voltage of the regulated 5v supply.
- Returns:
The current voltage of the 5v supply.
- get_analog_voltage(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.
- get_compressor() bool
- get_compressor_config_type() wpilib._wpilib.CompressorConfigType
- get_compressor_current() wpimath.units.amperes
- get_faults() wpilib._wpilib.PneumaticHub.Faults
Returns the faults currently active on this device.
- Returns:
The faults.
- get_input_voltage() wpimath.units.volts
Returns the current input voltage for this device.
- Returns:
The input voltage.
- get_module_number() int
- get_pressure(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.
- get_pressure_switch() bool
- get_solenoid_disabled_list() int
- get_solenoids() int
- get_solenoids_total_current() wpimath.units.amperes
Returns the total current drawn by all solenoids.
- Returns:
Total current drawn by all solenoids.
- get_solenoids_voltage() wpimath.units.volts
Returns the current voltage of the solenoid power supply.
- Returns:
The current voltage of the solenoid power supply.
- get_sticky_faults() wpilib._wpilib.PneumaticHub.StickyFaults
Returns the sticky faults currently active on this device.
- Returns:
The sticky faults.
- get_version() wpilib._wpilib.PneumaticHub.Version
Returns the hardware and firmware versions of this device.
- Returns:
The hardware and firmware versions.
- make_compressor() wpilib._wpilib.Compressor
- make_double_solenoid(forward_channel: SupportsInt | SupportsIndex, reverse_channel: SupportsInt | SupportsIndex) wpilib._wpilib.DoubleSolenoid
- make_solenoid(channel: SupportsInt | SupportsIndex) wpilib._wpilib.Solenoid
- report_usage(device: str, data: str) None
- reserve_compressor() bool
- set_one_shot_duration(index: SupportsInt | SupportsIndex, duration: wpimath.units.seconds) None
- set_solenoids(mask: SupportsInt | SupportsIndex, values: SupportsInt | SupportsIndex) None
- unreserve_compressor() None
- unreserve_solenoids(mask: SupportsInt | SupportsIndex) None