Create a servo object using a specified pin on a arduino board.
obj - servo object
arduinoobj - connected arduino object
propertyname, propertyvalue - name value pairs for properties to pass to the created servo object.
Current properties are:
min PWM pulse value in seconds.
max PWM pulse value in seconds.
obj - created servo object.
# create arduino connection ar = arduino(); # create hobby servo (1 - 2 ms pulse range) servo = servo(ar, "d9", "minpulseduration", 1.0e-3, "maxpulseduration", 2e-3); # center the servo writePosition(servo, 0.5);
The servo object has the following public properties:
The parent (arduino) for this device
pins used by this object
minpulseduration set for object
maxpulseduration set for object
See also: arduino, readPosition, writePosition.
Package: arduino