Class SafePWM

    • Constructor Detail

      • SafePWM

        public SafePWM​(int channel)
        Constructor for a SafePWM object taking a channel number.
        Parameters:
        channel - The channel number to be used for the underlying PWM object. 0-9 are on-board, 10-19 are on the MXP port.
    • Method Detail

      • setExpiration

        public void setExpiration​(double timeout)
        Set the expiration time for the PWM object.
        Specified by:
        setExpiration in interface MotorSafety
        Parameters:
        timeout - The timeout (in seconds) for this motor object
      • getExpiration

        public double getExpiration()
        Return the expiration time for the PWM object.
        Specified by:
        getExpiration in interface MotorSafety
        Returns:
        The expiration time value.
      • isAlive

        public boolean isAlive()
        Check if the PWM object is currently alive or stopped due to a timeout.
        Specified by:
        isAlive in interface MotorSafety
        Returns:
        a bool value that is true if the motor has NOT timed out and should still be running.
      • stopMotor

        public void stopMotor()
        Stop the motor associated with this PWM object. This is called by the MotorSafetyHelper object when it has a timeout for this PWM and needs to stop it from running.
        Specified by:
        stopMotor in interface MotorSafety
      • isSafetyEnabled

        public boolean isSafetyEnabled()
        Check if motor safety is enabled for this object.
        Specified by:
        isSafetyEnabled in interface MotorSafety
        Returns:
        True if motor safety is enforced for this object
      • Feed

        @Deprecated
        public void Feed()
        Deprecated.
        Use feed() instead.
        Feed the MotorSafety timer. This method is called by the subclass motor whenever it updates its speed, thereby resetting the timeout value.
      • feed

        public void feed()
        Feed the MotorSafety timer. This method is called by the subclass motor whenever it updates its speed, thereby resetting the timeout value.
      • disable

        public void disable()