Class SparkCollection

    • Constructor Summary

      Constructors 
      Constructor Description
      SparkCollection​(edu.wpi.first.wpilibj.Spark master, edu.wpi.first.wpilibj.Spark... slaves)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void enableRampRateLimiting​(boolean enabled)
      Set if ramp rate limiting should be enabled for the controller
      void forEachSlave​(java.util.function.Consumer<edu.wpi.first.wpilibj.Spark> consumer)
      For-Each over each slave controller
      double getEstimatedVoltage()
      Estimate controller output voltage from speed
      double getRampRate()
      Get the configured ramp rate
      void logStatus()
      Log component status
      void pidWrite​(double output)  
      void set​(double speed)  
      void setBuffer​(double speed)
      Only set on new data
      void setInverted​(boolean isInverted)  
      void setRampRate​(double secondsToFull)
      Set the controller ramp rate.
      void setVoltage​(double volts)
      Set desired controller output in volts.
      void updateTelemetry()
      Push telemetry data to NetworkTables
      • Methods inherited from class edu.wpi.first.wpilibj.SpeedControllerGroup

        close, disable, get, getInverted, initSendable, stopMotor
      • 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
      • Methods inherited from interface edu.wpi.first.wpilibj.SpeedController

        disable, get, getInverted, stopMotor
    • Constructor Detail

      • SparkCollection

        public SparkCollection​(edu.wpi.first.wpilibj.Spark master,
                               edu.wpi.first.wpilibj.Spark... slaves)
    • Method Detail

      • set

        public void set​(double speed)
        Specified by:
        set in interface edu.wpi.first.wpilibj.SpeedController
        Overrides:
        set in class edu.wpi.first.wpilibj.SpeedControllerGroup
      • setBuffer

        public void setBuffer​(double speed)
        Description copied from interface: IMotorCollection
        Only set on new data
        Specified by:
        setBuffer in interface IMotorCollection
        Parameters:
        speed - Motor speed
      • setInverted

        public void setInverted​(boolean isInverted)
        Specified by:
        setInverted in interface edu.wpi.first.wpilibj.SpeedController
        Overrides:
        setInverted in class edu.wpi.first.wpilibj.SpeedControllerGroup
      • pidWrite

        public void pidWrite​(double output)
        Specified by:
        pidWrite in interface edu.wpi.first.wpilibj.PIDOutput
        Overrides:
        pidWrite in class edu.wpi.first.wpilibj.SpeedControllerGroup
      • setVoltage

        public void setVoltage​(double volts)
        Description copied from interface: IVoltageOutputController
        Set desired controller output in volts. Negative voltage will result in reverse output
        Specified by:
        setVoltage in interface IVoltageOutputController
        Specified by:
        setVoltage in interface edu.wpi.first.wpilibj.SpeedController
        Parameters:
        volts - Controller output
      • setRampRate

        public void setRampRate​(double secondsToFull)
        Description copied from interface: IRampRateController
        Set the controller ramp rate.
        Specified by:
        setRampRate in interface IRampRateController
        Parameters:
        secondsToFull - Minimum desired time to go from neutral to full output.
      • enableRampRateLimiting

        public void enableRampRateLimiting​(boolean enabled)
        Description copied from interface: IRampRateController
        Set if ramp rate limiting should be enabled for the controller
        Specified by:
        enableRampRateLimiting in interface IRampRateController
        Parameters:
        enabled - Should enable limiting?
      • forEachSlave

        public void forEachSlave​(java.util.function.Consumer<edu.wpi.first.wpilibj.Spark> consumer)
        For-Each over each slave controller
        Parameters:
        consumer - Method to run
      • 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