Jetson.GPIO - Linux for Tegra
The Jetson TX1, TX2, AGX Xavier, and Nano 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/
or
https://github.com/NVIDIA/jetson-gpio
GPIO and BCM Comparison Table
Environmental configuration
git clone https://github.com/NVIDIA/jetson-gpio
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 ./
sudo apt-get install python3-pip
cd /opt/nvidia/jetson-gpio
sudo python3 setup.py install
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
sudo udevadm control --reload-rules && sudo udevadm trigger
Attention: user_ Name is the username you use, such as Jetson