001/*----------------------------------------------------------------------------*/ 002/* Copyright (c) 2008-2018 FIRST. 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 * Common interface for setting the speed of a speed controller. 016 * 017 * @param speed The speed to set. Value should be between -1.0 and 1.0. 018 */ 019 void set(double speed); 020 021 /** 022 * Common interface for getting the current set speed of a speed controller. 023 * 024 * @return The current set speed. Value is between -1.0 and 1.0. 025 */ 026 double get(); 027 028 /** 029 * Common interface for inverting direction of a speed controller. 030 * 031 * @param isInverted The state of inversion true is inverted. 032 */ 033 void setInverted(boolean isInverted); 034 035 /** 036 * Common interface for returning if a speed controller is in the inverted state or not. 037 * 038 * @return isInverted The state of the inversion true is inverted. 039 */ 040 boolean getInverted(); 041 042 /** 043 * Disable the speed controller. 044 */ 045 void disable(); 046 047 /** 048 * Stops motor movement. Motor can be moved again by calling set without having to re-enable the 049 * motor. 050 */ 051 void stopMotor(); 052}