set_position: Set the position of a servo instance.

Description Usage Arguments Value Methods (by class) Examples

Description

Sets the position of a given servo instance.

Usage

1
2
3
4
set_position(x, value)

## S4 method for signature 'Servo'
set_position(x, value)

Arguments

x

A Servo instance.

value

A numeric of length one. The new position of the servo as a value between -1 (the minimum position) and +1 (the maximum position).

Value

The same Servo instance provided as input.

Methods (by class)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
# Get a servo instance.
servo <- get_servo(14)
# Move the servo to its maximum position.
set_position(servo, 1)
# Move the servo to its minimum position.
set_position(servo, -1)
# Move the servo to its medium position.
set_position(servo, 0)

## End(Not run)

jcrodriguez1989/r2servo documentation built on Sept. 6, 2020, 12:07 a.m.