Welcome to AT8236 2-Channel Motor Driver Module repository
2.5 For jetson nano
Jetson nano
1. Preparation
Connect the motor drive board and Jetson nano according to the wiring diagram, connect the battery to the power input interface on motor drive module.


Note: The motor interface wire sequence of the dual motor drive board should correspond to the motor pin! Otherwise, the motor drive plate will be damaged.
Note: The motor interface wire sequence of the dual motor drive board.

2. Code
ximport RPi.GPIO as GPIO #Import libraryimport time
GPIO.setmode(GPIO.BCM) #Set pinAIN1 = 17AIN2 = 18BIN1 = 22 BIN2 = 23GPIO.setwarnings(False) #Remove warningGPIO.setup(AIN1, GPIO.OUT) #Set pin to output modeGPIO.output(AIN1, 0)GPIO.setup(AIN2, GPIO.OUT)GPIO.output(AIN2, 0)GPIO.setup(BIN1, GPIO.OUT)GPIO.output(BIN1, 0)GPIO.setup(BIN2, GPIO.OUT)GPIO.output(BIN2, 0)
def forward(): #Motor rotation GPIO.output(AIN1,1) GPIO.output(AIN2,0) GPIO.output(BIN1,1) GPIO.output(BIN2,0) def stop(): #Motor stop GPIO.output(AIN1,0) GPIO.output(AIN2,0) GPIO.output(BIN1,0) GPIO.output(BIN2,0)
forward() #Motor rotationtime.sleep(5) #Delay 5 secondsstop() #stopGPIO.cleanup() #clean up
3. Experimental result
Jetson nano runs the program. The motor drive board drives the motor to rotate, delaying for 5s, and then stops rotating.