Skip to contents

Returns the value of one or more specified board-level pin number (0-40). Stops if the pin is not a valid data line.

Usage

rpi_get(pin_number)

Arguments

pin_number

a Raspberry Pi GPIO board level pin number between 1 and 40. For example, Pin #1 is located upper left and provides 3.3 volts. Pin #40 is located lower right and is the location of GPIO21.

Value

named vector with the value of each pin number.

Examples

if (FALSE) { # is.rpi()
if (FALSE) {
rpi_get(1) # produces error since pin #1 is not data
}
rpi_get(40) # returns a named vector of the state of GPIO21. i.e. return["GPIO21"] = 1
rpi_get(c(7, 40)) # returns a named vector of values from pins 7 and 40
}