Examples:
# Read the value of a single GPIO line.
- # gpioget gpiochip1 23
+ $ gpioget gpiochip1 23
0
# Read two values at the same time. Set the active state of the lines
# to low.
- # gpioget --active-low gpiochip1 23 24
+ $ gpioget --active-low gpiochip1 23 24
1 1
# Set values of two lines, then daemonize and wait for a signal (SIGINT or
# SIGTERM) before releasing them.
- # gpioset --mode=signal --background gpiochip1 23=1 24=0
+ $ gpioset --mode=signal --background gpiochip1 23=1 24=0
# Set the value of a single line, then exit immediately. This is useful
# for floating pins.
- # gpioset gpiochip1 23=1
+ $ gpioset gpiochip1 23=1
# Find a GPIO line by name.
- # gpiofind "USR-LED-2"
+ $ gpiofind "USR-LED-2"
gpiochip1 23
# Toggle a GPIO by name, then wait for the user to press ENTER.
- # gpioset --mode=wait `gpiofind "USR-LED-2"`=1
+ $ gpioset --mode=wait `gpiofind "USR-LED-2"`=1
# Wait for three rising edge events on a single GPIO line, then exit.
- # gpiomon --num-events=3 --rising-edge gpiochip2 3
+ $ gpiomon --num-events=3 --rising-edge gpiochip2 3
event: RISING EDGE offset: 3 timestamp: [ 1151.814356387]
event: RISING EDGE offset: 3 timestamp: [ 1151.815449803]
event: RISING EDGE offset: 3 timestamp: [ 1152.091556803]
# Wait for a single falling edge event. Specify a custom output format.
- # gpiomon --format="%e %o %s %n" --falling-edge gpiochip1 4
+ $ gpiomon --format="%e %o %s %n" --falling-edge gpiochip1 4
0 4 1156 615459801
# Pause execution until a single event of any type occurs. Don't print
# anything. Find the line by name.
- # gpiomon --num-events=1 --silent `gpiofind "USR-IN"`
+ $ gpiomon --num-events=1 --silent `gpiofind "USR-IN"`
TESTING
-------