edu.wpi.first.wpilibj

## Class DoubleSolenoid

- java.lang.Object
- - edu.wpi.first.wpilibj.SensorBase
  - - edu.wpi.first.wpilibj.SolenoidBase
    - - edu.wpi.first.wpilibj.DoubleSolenoid

- All Implemented Interfaces:
    LiveWindowSendable, Sendable

      public class DoubleSolenoid
      extends SolenoidBase
      implements LiveWindowSendable

  DoubleSolenoid class for running 2 channels of high voltage Digital Output on the PCM.

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

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `DoubleSolenoid.Value` Possible values for a DoubleSolenoid.

  - ### Field Summary

    - ### Fields inherited from class edu.wpi.first.wpilibj.SolenoidBase

      `m_moduleNumber`

    - ### Fields inherited from class edu.wpi.first.wpilibj.SensorBase

      `kAnalogInputChannels, kAnalogOutputChannels, kDigitalChannels, kPCMModules, kPDPChannels, kPDPModules, kPwmChannels, kRelayChannels, kSolenoidChannels, kSystemClockTicksPerMicrosecond`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DoubleSolenoid(int forwardChannel, int reverseChannel)` Constructor.
    `DoubleSolenoid(int moduleNumber, int forwardChannel, int reverseChannel)` Constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `free()` Destructor.
    `DoubleSolenoid.Value` | `get()` Read the current value of the solenoid.
    `java.lang.String` | `getSmartDashboardType()` The string representation of the named data type that will be used by the smart dashboard for this `Sendable`.
    `void` | `initTable(NetworkTable subtable)` Initializes a table for this `Sendable` object.
    `boolean` | `isFwdSolenoidBlackListed()` Check if the forward solenoid is blacklisted.
    `boolean` | `isRevSolenoidBlackListed()` Check if the reverse solenoid is blacklisted.
    `void` | `set(DoubleSolenoid.Value value)` Set the value of a solenoid.
    `void` | `startLiveWindowMode()` Start having this sendable object automatically respond to value changes reflect the value on the table.
    `void` | `stopLiveWindowMode()` Stop having this sendable object automatically respond to value changes.
    `void` | `updateTable()` Update the table for this sendable object with the latest values.

    - ### Methods inherited from class edu.wpi.first.wpilibj.SolenoidBase

      `clearAllPCMStickyFaults, clearAllPCMStickyFaults, getAll, getAll, getPCMSolenoidBlackList, getPCMSolenoidBlackList, getPCMSolenoidVoltageFault, getPCMSolenoidVoltageFault, getPCMSolenoidVoltageStickyFault, getPCMSolenoidVoltageStickyFault`

    - ### Methods inherited from class edu.wpi.first.wpilibj.SensorBase

      `checkAnalogInputChannel, checkAnalogOutputChannel, checkDigitalChannel, checkPDPChannel, checkPDPModule, checkPWMChannel, checkRelayChannel, checkSolenoidChannel, checkSolenoidModule, getDefaultSolenoidModule, setDefaultSolenoidModule`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DoubleSolenoid

          public DoubleSolenoid(int forwardChannel,
                                int reverseChannel)

      Constructor. Uses the default PCM ID (defaults to 0).
      Parameters:
        `forwardChannel` - The forward channel number on the PCM (0..7).
        `reverseChannel` - The reverse channel number on the PCM (0..7).

    - #### DoubleSolenoid

          public DoubleSolenoid(int moduleNumber,
                                int forwardChannel,
                                int reverseChannel)

      Constructor.
      Parameters:
        `moduleNumber` - The module number of the solenoid module to use.
        `forwardChannel` - The forward channel on the module to control (0..7).
        `reverseChannel` - The reverse channel on the module to control (0..7).

  - ### Method Detail

    - #### free

          public void free()

      Destructor.
      Overrides:
        `free` in class `SensorBase`

    - #### set

          public void set(DoubleSolenoid.Value value)

      Set the value of a solenoid.
      Parameters:
        `value` - The value to set (Off, Forward, Reverse)

    - #### get

          public DoubleSolenoid.Value get()

      Read the current value of the solenoid.
      Returns:
        The current value of the solenoid.

    - #### isFwdSolenoidBlackListed

          public boolean isFwdSolenoidBlackListed()

      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.
      Returns:
        If solenoid is disabled due to short.
      See Also:
        `SolenoidBase.clearAllPCMStickyFaults()`

    - #### isRevSolenoidBlackListed

          public boolean isRevSolenoidBlackListed()

      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.
      Returns:
        If solenoid is disabled due to short.
      See Also:
        `SolenoidBase.clearAllPCMStickyFaults()`

    - #### getSmartDashboardType

          public java.lang.String getSmartDashboardType()

      Description copied from interface: `Sendable`
      The string representation of the named data type that will be used by the smart dashboard for this `Sendable`.
      Specified by:
        `getSmartDashboardType` in interface `Sendable`
      Returns:
        The type of this `Sendable`.

    - #### initTable

          public void initTable(NetworkTable subtable)

      Description copied from interface: `Sendable`
      Initializes a table for this `Sendable` object.
      Specified by:
        `initTable` in interface `Sendable`
      Parameters:
        `subtable` - The table to put the values in.

    - #### updateTable

          public void updateTable()

      Description copied from interface: `LiveWindowSendable`
      Update the table for this sendable object with the latest values.
      Specified by:
        `updateTable` in interface `LiveWindowSendable`

    - #### startLiveWindowMode

          public void startLiveWindowMode()

      Description copied from interface: `LiveWindowSendable`
      Start having this sendable object automatically respond to value changes reflect the value on the table.
      Specified by:
        `startLiveWindowMode` in interface `LiveWindowSendable`

    - #### stopLiveWindowMode

          public void stopLiveWindowMode()

      Description copied from interface: `LiveWindowSendable`
      Stop having this sendable object automatically respond to value changes.
      Specified by:
        `stopLiveWindowMode` in interface `LiveWindowSendable`