Class DoubleSolenoid

  • All Implemented Interfaces:
    Sendable, AutoCloseable

    public class DoubleSolenoid
    extends SolenoidBase
    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.

    • 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

      • 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()
      • initSendable

        public void initSendable​(SendableBuilder builder)
        Description copied from interface: Sendable
        Initializes this Sendable object.
        Parameters:
        builder - sendable builder