我尝试在 jetson nano 上使用 RPI 代码运行 5v 步进电机,它给了我 ValueError: The channel sent is invalid on a JETSON_NANO Board
我已经安装了jetson gpio,但仍然给我同样的错误,但代码在树莓派上运行良好
import Jetson.GPIO as GPIO
#import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
#GPIO.setmode(GPIO.BOARD)
control_pins = [3,5,7,11]
for pin in control_pins:
GPIO.setup(pin, GPIO.OUT)
GPIO.output(pin, 0)
halfstep_seq = [
[1,0,0,0],
[1,1,0,0],
[0,1,0,0],
[0,1,1,0],
[0,0,1,0],
[0,0,1,1],
[0,0,0,1],
[1,0,0,1]
]
for i in range(56):
for halfstep in range(8):
for pin in range(4):
GPIO.output(control_pins[pin], halfstep_seq[halfstep][pin])
time.sleep(0.001)
GPIO.cleanup()