DoubleSolenoid¶
- class wpilib.DoubleSolenoid(*args, **kwargs)¶
Bases:
Sendable
DoubleSolenoid class for running 2 channels of high voltage Digital Output on a pneumatics module.
The DoubleSolenoid class is typically used for pneumatics solenoids that have two positions controlled by two separate channels.
Overloaded function.
__init__(self: wpilib._wpilib.DoubleSolenoid, module: int, moduleType: wpilib._wpilib.PneumaticsModuleType, forwardChannel: int, reverseChannel: int) -> None
Constructs a double solenoid for a specified module of a specific module type.
- Parameters:
module – The module of the solenoid module to use.
moduleType – The module type to use.
forwardChannel – The forward channel on the module to control.
reverseChannel – The reverse channel on the module to control.
__init__(self: wpilib._wpilib.DoubleSolenoid, moduleType: wpilib._wpilib.PneumaticsModuleType, forwardChannel: int, reverseChannel: int) -> None
Constructs a double solenoid for a default module of a specific module type.
- Parameters:
moduleType – The module type to use.
forwardChannel – The forward channel on the module to control.
reverseChannel – The reverse channel on the module to control.
- class Value(value: int)¶
Bases:
pybind11_object
Members:
kOff
kForward
kReverse
- kForward = <Value.kForward: 1>¶
- kOff = <Value.kOff: 0>¶
- kReverse = <Value.kReverse: 2>¶
- property name¶
- property value¶
- get() wpilib._wpilib.DoubleSolenoid.Value ¶
Read the current value of the solenoid.
- Returns:
The current value of the solenoid.
- getFwdChannel() int ¶
Get the forward channel.
- Returns:
the forward channel.
- getRevChannel() int ¶
Get the reverse channel.
- Returns:
the reverse channel.
- initSendable(builder: wpiutil._wpiutil.SendableBuilder) None ¶
- isFwdSolenoidDisabled() bool ¶
Check if the forward solenoid is Disabled.
If a solenoid is shorted, it is added to the DisabledList and disabled until power cycle, or until faults are cleared.
@see ClearAllPCMStickyFaults()
- Returns:
If solenoid is disabled due to short.
- isRevSolenoidDisabled() bool ¶
Check if the reverse solenoid is Disabled.
If a solenoid is shorted, it is added to the DisabledList and disabled until power cycle, or until faults are cleared.
@see ClearAllPCMStickyFaults()
- Returns:
If solenoid is disabled due to short.
- set(value: wpilib._wpilib.DoubleSolenoid.Value) None ¶
Set the value of a solenoid.
- Parameters:
value – The value to set (Off, Forward or Reverse)
- toggle() None ¶
Toggle the value of the solenoid.
If the solenoid is set to forward, it’ll be set to reverse. If the solenoid is set to reverse, it’ll be set to forward. If the solenoid is set to off, nothing happens.