DoubleSolenoid

class wpilib.DoubleSolenoid(*args, **kwargs)[source]

Bases: wpilib.SolenoidBase

Controls 2 channels of high voltage Digital Output.

The DoubleSolenoid class is typically used for pneumatics solenoids that have two positions controlled by two separate channels.

Constructor.

Arguments can be supplied as positional or keyword. Acceptable positional argument combinations are:

  • forwardChannel, reverseChannel
  • moduleNumber, forwardChannel, reverseChannel

Alternatively, the above names can be used as keyword arguments.

Parameters:
  • moduleNumber – The module number of the solenoid module to use.
  • forwardChannel – The forward channel number on the PCM (0..7)
  • reverseChannel – The reverse channel number on the PCM (0..7)
class Value[source]

Bases: builtins.object

Possible values for a DoubleSolenoid.

kForward = 1
kOff = 0
kReverse = 2
DoubleSolenoid.free()[source]

Mark the solenoid as freed.

DoubleSolenoid.get()[source]

Read the current value of the solenoid.

Returns:The current value of the solenoid.
Return type:DoubleSolenoid.Value
DoubleSolenoid.isFwdSolenoidBlackListed()[source]
Check if the forward solenoid is blacklisted.
If a solenoid is shorted, it is added to the blacklist and disabled until power cycle, or until faults are cleared. See clearAllPCMStickyFaults()
Returns:If solenoid is disabled due to short.
DoubleSolenoid.isRevSolenoidBlackListed()[source]
Check if the reverse solenoid is blacklisted.
If a solenoid is shorted, it is added to the blacklist and disabled until power cycle, or until faults are cleared. See clearAllPCMStickyFaults()
Returns:If solenoid is disabled due to short.
DoubleSolenoid.set(value)[source]

Set the value of a solenoid.

Parameters:value (DoubleSolenoid.Value) – The value to set (Off, Forward, Reverse)