DoubleSolenoid

class wpilib.DoubleSolenoid(*args, **kwargs)

Bases: wpilib.SolenoidBase, wpilib.Sendable

DoubleSolenoid class for running 2 channels of high voltage Digital Output (PCM).

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

Overloaded function.

  1. __init__(self: wpilib._wpilib.DoubleSolenoid, forwardChannel: int, reverseChannel: int) -> None

Constructor.

Uses the default PCM ID of 0.

Parameters
  • forwardChannel – The forward channel number on the PCM (0..7).

  • reverseChannel – The reverse channel number on the PCM (0..7).

  1. __init__(self: wpilib._wpilib.DoubleSolenoid, moduleNumber: int, forwardChannel: int, reverseChannel: int) -> None

Constructor.

Parameters
  • moduleNumber – The CAN ID of the PCM.

  • forwardChannel – The forward channel on the PCM to control (0..7).

  • reverseChannel – The reverse channel on the PCM to control (0..7).

class Value(self: wpilib._wpilib.DoubleSolenoid.Value, value: int) → None

Bases: pybind11_builtins.pybind11_object

Members:

kOff

kForward

kReverse

kForward = <Value.kForward: 1>
kOff = <Value.kOff: 0>
kReverse = <Value.kReverse: 2>
property name
get(self: wpilib.DoubleSolenoid) → wpilib._wpilib.DoubleSolenoid.Value

Read the current value of the solenoid.

Returns

The current value of the solenoid.

initSendable(self: wpilib.DoubleSolenoid, builder: wpilib.SendableBuilder) → None
isFwdSolenoidBlackListed(self: wpilib.DoubleSolenoid) → bool

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.

isRevSolenoidBlackListed(self: wpilib.DoubleSolenoid) → bool

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.

set(self: wpilib.DoubleSolenoid, value: wpilib._wpilib.DoubleSolenoid.Value) → None

Set the value of a solenoid.

Parameters

value – The value to set (Off, Forward or Reverse)

toggle(self: wpilib.DoubleSolenoid) → 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.