001/*----------------------------------------------------------------------------*/
002/* Copyright (c) FIRST 2008-2017. All Rights Reserved.                        */
003/* Open Source Software - may be modified and shared by FRC teams. The code   */
004/* must be accompanied by the FIRST BSD license file in the root directory of */
005/* the project.                                                               */
006/*----------------------------------------------------------------------------*/
007
008package edu.wpi.first.wpilibj;
009
010/**
011 * Interface for speed controlling devices.
012 */
013public interface SpeedController extends PIDOutput {
014
015  /**
016   * Common interface for getting the current set speed of a speed controller.
017   *
018   * @return The current set speed. Value is between -1.0 and 1.0.
019   */
020  double get();
021
022  /**
023   * Common interface for setting the speed of a speed controller.
024   *
025   * @param speed The speed to set. Value should be between -1.0 and 1.0.
026   */
027  void set(double speed);
028
029  /**
030   * Common interface for inverting direction of a speed controller.
031   *
032   * @param isInverted The state of inversion true is inverted.
033   */
034  void setInverted(boolean isInverted);
035
036  /**
037   * Common interface for returning if a speed controller is in the inverted state or not.
038   *
039   * @return isInverted The state of the inversion true is inverted.
040   */
041  boolean getInverted();
042
043  /**
044   * Disable the speed controller.
045   */
046  void disable();
047
048  /**
049   * Stops motor movement. Motor can be moved again by calling set without having to re-enable the
050   * motor.
051   */
052  void stopMotor();
053}