Class LazySolenoid

  • All Implemented Interfaces:
    edu.wpi.first.wpilibj.Sendable, Loggable, java.lang.AutoCloseable

    public class LazySolenoid
    extends edu.wpi.first.wpilibj.Solenoid
    implements Loggable
    Buffer solenoid commands to reduce CAN spam. For some reason, solenoid commands take up a lot of compute
    • Field Summary

      • Fields inherited from class edu.wpi.first.wpilibj.SolenoidBase

        m_moduleNumber
    • Constructor Summary

      Constructors 
      Constructor Description
      LazySolenoid​(int moduleNumber, int channel)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void flush()
      re-send the current state to flush CAN
      void logStatus()
      Log component status
      void set​(boolean on)
      Set the value of a solenoid, but reduce CAN spam by only sending new data
      void updateTelemetry()
      Push telemetry data to NetworkTables
      • Methods inherited from class edu.wpi.first.wpilibj.Solenoid

        close, get, initSendable, isBlackListed, setPulseDuration, startPulse
      • Methods inherited from class edu.wpi.first.wpilibj.SolenoidBase

        clearAllPCMStickyFaults, clearAllPCMStickyFaults, getAll, getAll, getPCMSolenoidBlackList, getPCMSolenoidBlackList, getPCMSolenoidVoltageFault, getPCMSolenoidVoltageFault, getPCMSolenoidVoltageStickyFault, getPCMSolenoidVoltageStickyFault
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface edu.wpi.first.wpilibj.Sendable

        addChild, getName, getSubsystem, setName, setName, setName, setName, setSubsystem
    • Constructor Detail

      • LazySolenoid

        public LazySolenoid​(int moduleNumber,
                            int channel)
    • Method Detail

      • set

        public void set​(boolean on)
        Set the value of a solenoid, but reduce CAN spam by only sending new data
        Overrides:
        set in class edu.wpi.first.wpilibj.Solenoid
        Parameters:
        on - Should the solenoid turn on?
      • flush

        public void flush()
        re-send the current state to flush CAN
      • logStatus

        public void logStatus()
        Description copied from interface: Loggable
        Log component status
        Specified by:
        logStatus in interface Loggable
      • updateTelemetry

        public void updateTelemetry()
        Description copied from interface: Loggable
        Push telemetry data to NetworkTables
        Specified by:
        updateTelemetry in interface Loggable