WPILibC++  2018.4.1-20180819221726-1160-g6df500e
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
SpeedController.h
1 /*----------------------------------------------------------------------------*/
2 /* Copyright (c) 2008-2018 FIRST. All Rights Reserved. */
3 /* Open Source Software - may be modified and shared by FRC teams. The code */
4 /* must be accompanied by the FIRST BSD license file in the root directory of */
5 /* the project. */
6 /*----------------------------------------------------------------------------*/
7 
8 #pragma once
9 
10 #include "frc/PIDOutput.h"
11 
12 namespace frc {
13 
17 class SpeedController : public PIDOutput {
18  public:
19  virtual ~SpeedController() = default;
20 
26  virtual void Set(double speed) = 0;
27 
33  virtual double Get() const = 0;
34 
40  virtual void SetInverted(bool isInverted) = 0;
41 
47  virtual bool GetInverted() const = 0;
48 
52  virtual void Disable() = 0;
53 
57  virtual void StopMotor() = 0;
58 };
59 
60 } // namespace frc
Interface for speed controlling devices.
Definition: SpeedController.h:17
WPILib FRC namespace.
Definition: SPIAccelerometerSim.h:18
virtual double Get() const =0
Common interface for getting the current set speed of a speed controller.
virtual void Disable()=0
Common interface for disabling a motor.
PIDOutput interface is a generic output for the PID class.
Definition: PIDOutput.h:20
virtual void Set(double speed)=0
Common interface for setting the speed of a speed controller.
virtual void StopMotor()=0
Common interface to stop the motor until Set is called again.
virtual bool GetInverted() const =0
Common interface for returning the inversion state of a speed controller.
virtual void SetInverted(bool isInverted)=0
Common interface for inverting direction of a speed controller.