Now you can download a copy of these docs so you can use them offline! Download now

#include <Servo.h>

Inheritance diagram for Servo:
Collaboration diagram for Servo:

List of all members.

Public Member Functions

 Servo (UINT32 channel)
 Servo (UINT8 moduleNumber, UINT32 channel)
void Set (float value)
void SetOffline ()
float Get ()
void SetAngle (float angle)
float GetAngle ()

Static Public Member Functions

static float GetMaxAngle ()
static float GetMinAngle ()

Detailed Description

Standard hobby style servo.

The range parameters default to the appropriate values for the Hitec HS-322HD servo provided in the FIRST Kit of Parts in 2008.

Definition at line 19 of file Servo.h.


Constructor & Destructor Documentation

Servo::Servo ( UINT32  channel  )  [explicit]

Constructor that assumes the default digital module.

Parameters:
channel The PWM channel on the digital module to which the servo is attached.

Definition at line 30 of file Servo.cpp.

Servo::Servo ( UINT8  moduleNumber,
UINT32  channel 
)

Constructor that specifies the digital module.

Parameters:
moduleNumber The digital module (1 or 2).
channel The PWM channel on the digital module to which the servo is attached (1..10).

Definition at line 41 of file Servo.cpp.


Member Function Documentation

float Servo::Get (  ) 

Get the servo position.

Servo values range from 0.0 to 1.0 corresponding to the range of full left to full right.

Returns:
Position from 0.0 to 1.0.

Definition at line 78 of file Servo.cpp.

float Servo::GetAngle ( void   ) 

Get the servo angle.

Assume that the servo angle is linear with respect to the PWM value (big assumption, need to test).

Returns:
The angle in degrees to which the servo is set.

Definition at line 114 of file Servo.cpp.

void Servo::Set ( float  value  ) 

Set the servo position.

Servo values range from 0.0 to 1.0 corresponding to the range of full left to full right.

Parameters:
value Position from 0.0 to 1.0.

Definition at line 57 of file Servo.cpp.

void Servo::SetAngle ( float  degrees  ) 

Set the servo angle.

Assume that the servo angle is linear with respect to the PWM value (big assumption, need to test).

Servo angles that are out of the supported range of the servo simply "saturate" in that direction In other words, if the servo has a range of (X degrees to Y degrees) than angles of less than X result in an angle of X being set and angles of more than Y degrees result in an angle of Y being set.

Parameters:
degrees The angle in degrees to set the servo.

Definition at line 94 of file Servo.cpp.

void Servo::SetOffline (  ) 

Set the servo to offline.

Set the servo raw value to 0 (undriven)

Definition at line 67 of file Servo.cpp.


The documentation for this class was generated from the following files:

Generated on Thu Jan 12 2012 22:35:36 for WPILibC++ by doxygen 1.7.1