#include <Servo.h>
Public Member Functions | |
Servo (unsigned channel) | |
Servo (unsigned slot, unsigned channel) | |
void | Set (float value) |
float | Get (void) |
void | SetAngle (float angle) |
float | GetAngle (void) |
Servo::Servo | ( | unsigned | channel | ) |
Constructor that assumes the default digital module.
channel | The PWM channel on the digital module that the servo is attached to. |
Servo::Servo | ( | unsigned | slot, | |
unsigned | channel | |||
) |
Constructor that specifies the digital module.
slot | The slot in the chassis that the digital module is plugged into. | |
channel | The PWM channel on the digital module that the servo is attached to. |
void Servo::Set | ( | float | value | ) |
Set the servo position.
Servo values range from 0.0 to 1.0 that corresponds to full left to full right.
value | Position from 0.0 to 1.0. |
float Servo::Get | ( | void | ) |
Get the servo position.
Servo values range from 0.0 to 1.0 that corresponds to full left to full right.
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).
degrees | The angle in degrees to set the servo. |
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). s