Jetson.GPIO - Linux for Tegra
The Jetson TX1, TX2, AGX Xavier, Nano, and Orin series development boards include a 40 pin GPIO connector, similar to the 40 pin connector in Raspberry Pi. You can use the Python library provided in the Jetson GPIO Library package to control the digital inputs and outputs of these GPIOs. This library shares the same API as Raspberry Pi's RPi. GPIO library to provide a convenient way to move applications running on Raspberry Pi to the Jetson board.
In addition to this document, the Jetson GPIO library package also includes the following content:
This document will introduce the content contained in the Jetson GPIO library package, how to configure the system, and run the provided sample applications and library APIs. Here we briefly introduce how to use this library for Jetson.GPIO, with detailed instructions: https://pypi.org/project/Jetson.GPIO/ 或者 https://github.com/NVIDIA/jetson-gpio
GPIO and BCM Comparison Table
Environmental configuration
1、DownLoad jetson-gpio:
git clone https://github.com/NVIDIA/jetson-gpio
2、Move downloaded files to directory: /opt/nvidia 中
If your directory exists in this library, we need to backup the original directory as follows:
Then place the downloaded folder in the opt/nvidia directory. Since I am placing the folder in the path~/and currently in opt/nvidia, I can execute the following command to move the folder.
sudo mv ~/jetson-gpio ./
3、Install pip3 tool: sudo apt-get install python3-pip
4、Enter the Jetson gpio library folder and install the library。
cd /opt/nvidia/jetson-gpio
sudo python3 setup.py install
5、Before using, you also need to create a GPIO group, add your current account to this group, and grant usage permissions
sudo groupadd -f -r gpio
sudo usermod -a -G gpio user_name
sudo cp /opt/nvidia/jetson-gpio/lib/python/Jetson/GPIO/99-gpio.rules /etc/udev/rules.d/ In order for the new rule to take effect, you need to reboot or reload the udev rule by running the following command
xxxxxxxxxx
sudo udevadm control --reload-rules && sudo udevadm trigger
Attention: user_ Name is the username you use, such as Jetson