使用 gpiod 从命令行控制 GPIO


Install gpiod

sudo apt update
sudo apt install gpiod

Six command-line tools are available:

* gpiodetect - list all gpiochips present on the system, their names, labels
               and number of GPIO lines

* gpioinfo   - list all lines of specified gpiochips, their names, consumers,
               direction, active state and additional flags

* gpioget    - read values of specified GPIO lines

* gpioset    - set values of specified GPIO lines, potentially keep the lines
               exported and wait until timeout, user input or signal

* gpiofind   - find the gpiochip name and line offset given the line name

* gpiomon    - wait for events on GPIO lines, specify which events to watch,
               how many events to process before exiting or if the events
               should be reported to the console

 

 

 

产品推荐

11F5E1
11F5E1

Jetson™ Orin NX丨Orin Nano

28F1E4
28F1E4

Jetson™ Thor T5000丨T4000

18F1E1
18F1E1

Jetson™ Orin NX丨Orin Nano

17F1
17F1

Jetson™ Orin NX丨Orin Nano丨Xavier NX

获取文档
项目定制
售前咨询
售后服务
联系我们