jetson orin nano 40针引脚扩展接头:
图源 Jetson Orin Nano Developer Kit User Guide - | NVIDIA Developer
引脚配置
使用jetson-io tool配置引脚:
sudo /opt/nvidia/jetson-io/jetson-io.py
选择“Configure Jetson 40pin Header”:
"Configure header pins manually":
配置15、33针脚发送PWM信号:
32引脚有坑。
保存设置并重启生效:
接线
1号舵机 VCC接2号针脚5V电压,GND接6号针脚GND,Signal接15号针脚PWM控制信号
2号舵机 VCC接4号针脚5V电压,GND接14号针脚GND,Signal接33号针脚PWM控制信号
demo
import RPi.GPIO as GPIO
from time import sleep
# set mode to BOARD, pins are by numbers on board
GPIO.setmode(GPIO.BOARD)
# define output pin
output_pin = [15, 33]
# GPIO setup
GPIO.setup(output_pin, GPIO.OUT)
# start
servo=GPIO.PWM(output_pin[0], 50)
servo.start(0)
sleep(1)
# move left
servo.ChangeDutyCycle(5)
sleep(1)
# move right
servo.ChangeDutyCycle(12)
sleep(1)
# stop and cleanup
servo.stop()
GPIO.cleanup()