I'm simply trying to drive a motor in one direction for the moment, to test my SN754410 H-bridge, but it doesn't work.
Here is how the motor and my H-Bridge are connected :
And here is my python code :
Code: Select all
import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) motor1p = 17 motor1n = 27 GPIO.setup(motor1p, GPIO.OUT) GPIO.setup(motor1n, GPIO.OUT) time.sleep(0.1) GPIO.output(motor1p, GPIO.LOW) GPIO.output(motor1n, GPIO.LOW) time.sleep(0.5) GPIO.output(motor1p, GPIO.HIGH) GPIO.output(motor1n, GPIO.LOW) time.sleep(2) GPIO.cleanup()
What did I do wrong?