get_servo: Get a servo instance.

Description Usage Arguments Value Examples

View source: R/get_servo.R

Description

Returns a configured servo instance.

Usage

1
get_servo(pin, initial_value = 0)

Arguments

pin

A character or numeric of length one with the GPIO pin that the servo is connected to.

initial_value

A numeric of length one. If 0 (the default), the device's mid-point will be set initially. Other values between -1 and +1 can be specified as an initial position. If 'NULL', it will not move.

Value

A Servo S4 object, this object will be set to work with the configured servo.

Examples

1
2
3
4
5
6
7
## Not run: 
# Get a servo instance connected at GPIO 14.
servo_14 <- get_servo(14)
# Get a servo instance connected at GPIO 18.
servo_18 <- get_servo(18)

## End(Not run)

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