Next: Arduino Shiftregister Functions, Previous: Arduino Rotary Encoder Functions, Up: Function Reference [Contents][Index]
Free resources of a servo object.
dev - object to free
See also: servo.
Display servo object.
dev - device to display
See also: servo.
Read the position of a servo
servo - servo object created from arduino.servo.
position - value between 0 .. 1 for the current servo position, where 0 is the servo min position, 1 is the servo maximum position.
See also: servo, writePosition.
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.
subref for servo
See also: servo.
Write the position to a servo.
servo - servo object created from arduino.servo.
position - value between 0 .. 1 for the current servo position, where 0 is the servo min position, 1 is the servo maximum position.
See also: servo, readPosition.
Next: Arduino Shiftregister Functions, Previous: Arduino Rotary Encoder Functions, Up: Function Reference [Contents][Index]