-
Notifications
You must be signed in to change notification settings - Fork 0
The SpeedController Interface
Zach Anderson edited this page Jan 24, 2014
·
2 revisions
The cRIO's outputs cannot supply the current necessary to power the robot's motors. To control the motors, we use physical speed controllers that act like a pipe valve, allowing the cRIO's tiny current to vary the larger current going directly from the battery to the motors. The WPILibrary gives us the SpeedController
interface for dealing with speed controllers. As SpeedController
is an interface, we can't use it directly. To use it we must use one of the classes that implements SpeedController
. The WPILibrary provides three: Talon
, Victor
, and Jaguar
.
###Methods
SpeedController
provides two important methods:
-
get()
returns the current speed assigned to the speed controller as a double between -1.0 and 1.0. -
set(speed)
sets the speed of the speed controller as a double between -1.0 and 1.0.