4

I tried running a 5v stepper motor using RPI code on jetson nano and it gives me ValueError: The channel sent is invalid on a JETSON_NANO Board

I have installed jetson gpio and still giving me same error but the code works fine on raspberry pi

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()

1 Answers1

0

You need to use the number-s indicated by Dxx labels from the bottom of the dev board: enter image description here

So, assuming we want to use the physical pins 3, 5, 7 and 11, the control_pins array should be [2, 3, 4, 17]

bluetiger9
  • 718
  • 7
  • 16