4-3 GPIO Output Control

Use simple libgpiod tools to control GPIO. We will use GPIO01 (PQ.05) as an example again, assuming you have already found its number is gpiochip0 105 using gpiofind PQ.05.


1. Set as Output and Control Value

Use the gpioset command to directly set the pin as output and assign a value:

Set to High (e.g., turn on LED):

gpioset --mode=wait `gpiofind "PQ.05"`=1

Set to Low (e.g., turn off LED):

When you want to connect to your USB camera, the most common and simple way to do it is like this:

gpioset --mode=wait `gpiofind "PQ.05"`=0

Quick Tip: --mode=wait keeps the setting active after the command executes until you press Ctrl+C to exit. If you don't add this, the setting might end immediately, and the LED might just flash once and turn off.


Summary

Use the gpioset command to easily configure output and set High/Low levels.

 

Copyright © 2026 YUAN High-Tech Development Co., Ltd.
All rights reserved.