blob: 3e2e9dd99d1ea126388dc801bfb99171b5580c7f [file] [log] [blame]
jerrymf1579332013-02-07 01:56:28 +00001/*----------------------------------------------------------------------------*/
2/* Copyright (c) FIRST 2008. 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 $(WIND_BASE)/WPILib. */
5/*----------------------------------------------------------------------------*/
6
7#ifndef SPEED_CONTROLLER_H
8#define SPEED_CONTROLLER_H
9
10#include <vxWorks.h>
11#include "PIDOutput.h"
12
13/**
14 * Interface for speed controlling devices.
15 */
16class SpeedController : public PIDOutput
17{
18public:
19 virtual ~SpeedController() {};
20 /**
21 * Common interface for setting the speed of a speed controller.
22 *
23 * @param speed The speed to set. Value should be between -1.0 and 1.0.
24 * @param syncGroup The update group to add this Set() to, pending UpdateSyncGroup(). If 0, update immediately.
25 */
26 virtual void Set(float speed, UINT8 syncGroup=0) = 0;
27 /**
28 * Common interface for getting the current set speed of a speed controller.
29 *
30 * @return The current set speed. Value is between -1.0 and 1.0.
31 */
32 virtual float Get() = 0;
33 /**
34 * Common interface for disabling a motor.
35 */
36 virtual void Disable() = 0;
37};
38
39#endif
40