get_led: Get a led instance.

Description Usage Arguments Value Examples

View source: R/get_led.R

Description

Returns a configured led instance.

Usage

1
get_led(pin, initial_value = FALSE)

Arguments

pin

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

initial_value

A logical of length one. If 'FALSE' (the default), the LED will be off initially. If 'NULL', the LED will be left in whatever state the pin is found in when configured for output (warning: this can be on). If 'TRUE', the LED will be switched on initially.

Value

A LED S4 object, this object will be set to work with the configured led.

Examples

1
2
3
4
5
6
7
## Not run: 
# Get a led instance connected at GPIO 14.
led_14 <- get_led(14)
# Get a led instance connected at GPIO 18.
led_18 <- get_led(18)

## End(Not run)

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