Skip to contents

Watch a Raspberry pi GPIO pin (or pins) for changes.

Usage

rpi_monitor(pin_number, numEvents = 0, edge = "both")

Arguments

pin_number

one or more pin numbers as found on the Raspberry pi GPIO. Use the actual pin numbers (i.e. 1:40)

numEvents

a number of events to collect. Defaults to 10

edge

rising|falling|both

Value

a list of events

  • raw text of each event

  • event: RISING EDGE|FALLING EDGE

  • line: the bcm line (not board pin) exhibiting change

  • timestamp: seconds component

  • timestamp: nanoseconds component

Examples

if (FALSE) { # is.rpi()
# \donttest{
rpi_monitor(21)
rpi_monitor(21, numEvents = 20)
# }
}