Servo
Last updated
Last updated
Driver for PWM controlled servo motors.
Type
Name
PwmOut
float
float
float
Type
Name
void
float
void
void
Create a servo object connected to the specified PwmOut pin
Parameters:
pin PwmOut pin to connect to
Set the servo position, normalised to it's full range
Parameters:
percent A normalised number 0.0-1.0 to represent the full range.
Read the servo motors current position
Parameters:
returns A normalised number 0.0-1.0 representing the full range.
Set the servo position
Parameters:
Allows calibration of the range and angles for a particular servo
Parameters:
range Pulsewidth range from center (1.5ms) to maximum/minimum position in seconds
degrees Angle from centre to maximum/minimum position in degrees
Shorthand for the write and read functions
The documentation for this class was generated from the following file: D:/w/hw-libs/\_libs\_/libraries/Servo.h
(PinName pin)
(float percent)
()
(float degrees)
(float range = 0.0005, float degrees = 45.0)
&
(float percent)
&
( & rhs)
()
control class, based on a PwmOut Example:
degrees position in degrees