Class PWMSpeedController

    • Constructor Detail

      • PWMSpeedController

        protected PWMSpeedController​(int channel)
        channel - The PWM channel that the controller is attached to. 0-9 are on-board, 10-19 are on the MXP port
    • Method Detail

      • set

        public void set​(double speed)
        Set the PWM value.

        The PWM value is set using a range of -1.0 to 1.0, appropriately scaling the value for the FPGA.

        Specified by:
        set in interface SpeedController
        speed - The speed value between -1.0 and 1.0 to set.
      • get

        public double get()
        Get the recently set value of the PWM.
        Specified by:
        get in interface SpeedController
        The most recently set value for the PWM between -1.0 and 1.0.
      • setInverted

        public void setInverted​(boolean isInverted)
        Description copied from interface: SpeedController
        Common interface for inverting direction of a speed controller.
        Specified by:
        setInverted in interface SpeedController
        isInverted - The state of inversion true is inverted.
      • getInverted

        public boolean getInverted()
        Description copied from interface: SpeedController
        Common interface for returning if a speed controller is in the inverted state or not.
        Specified by:
        getInverted in interface SpeedController
        isInverted The state of the inversion true is inverted.
      • pidWrite

        public void pidWrite​(double output)
        Write out the PID value as seen in the PIDOutput base object.
        Specified by:
        pidWrite in interface PIDOutput
        output - Write out the PWM value as was found in the PIDController