Jetson Nano GPIO说明及Python案例

树莓派 徐 自远 1723℃

https://www.jianshu.com/p/f98a69b94deb

1. Jetson.GPIO 库

Jetson.GPIO库 已经预装在Nano,无需再安装其他GPIO Python库,如果安装了其他GPIO库需先卸载方可以正常适用Jetson.GPIO, 预安装路径:

/opt/nvidia/jetson-gpio

运行Jetson.GPIO前需运行以下步骤,建立GPIO 运行环境
步骤一 – 设置运行权限Setup permissions

 

步骤二 – Python 代码引用
添加如下Python 代码后,才可以调用 import the RPi.GPIO (或者 motorhat library等)

 

步骤三:Python GPIO 案例
GPIO Mode

 


如下已验证代码案例(测量J41 PIN13,每隔2s 置高置低即0/1/0/1)

 

#!/usr/bin/env python

#BCM 是Broadcom SOC GPIO序列号,此处需修改为BOARD#即Nano载板的40Pin GPIO序列号,参考上图<Nano_J41_40Pin.png>

2. 超声波HC-SR04 应用案例

3. Jetson Nano GPIO一些说明:

Jetson.GPIO Library doesn’t support PWM**
(不支持PWM,如需要PWM需外接一个I2C转PWM信号的板子)
However, the following I2C controlled board can generate PWM signals up to ~1.6kHz and should have Python libraries available.
https://www.adafruit.com/product/815

You could potentially connect this to whatever H-Bridge meets the power requirements of your application. The motor driver we used for JetBot actually combines this chip and multiple H-bridge on the same board.
https://www.adafruit.com/product/2927



PS:
NVIDIA Forum:
Nano GPIO Python support
https://pypi.org/project/Jetson.GPIO/

Jetson Nano GPIO 代码目录及部分说明
GPIO DTS:
hardware/nvidia/platform/t210/porg/kernel-dts/porg-platforms/tegra210-porg-gpio-p3448-0002-a02.dtsi

P37-gpio12-GPIO.B04
P22-gpio13-GPIO.B05
P13-gpio14-GPIO.B06
P18-gpio15-GPIO.B07
VDD-USB-HUB-EN gpio151-GPIO.S07

IMX219 DTS:
hardware\nvidia\platform\t210\porg\kernel-dts\porg-platforms\tegra210-porg-camera-rbpcv2-imx219.dtsi

 

转载请注明:徐自远的乱七八糟小站 » Jetson Nano GPIO说明及Python案例

喜欢 (1)

苏ICP备18041234号-1 bei_an 苏公网安备 32021402001397号