The driver I'm using is located here. There is a wiring diagram included in the link:
And here is a mock up of my current wiring. I am assuming that the logic power can be provided by the RPi 3.3v pin. I'm not using the two bottom points on the driver board, as I don't think they're necessary for my purposes.
I picked up a multimeter just to make sure my pins are outputting correct power, but that seems to be the case. I'm wondering if I'm just missing some fundamental piece in wiring up the circuitry.
My code is here:
Code: Select all
#!/usr/bin/env python import RPi.GPIO as GPIO import time MotorPin_A = 16 MotorPin_B = 18 speed = 50 pwm_B = 0 def motorStop(): GPIO.output(MotorPin_A, GPIO.HIGH) GPIO.output(MotorPin_B, GPIO.LOW) def setup(): GPIO.setwarnings(False) GPIO.setmode(GPIO.BOARD) GPIO.setup(MotorPin_A, GPIO.OUT) GPIO.setup(MotorPin_B, GPIO.OUT) motorStop() # global pwm_B # pwm_B = GPIO.PWM(MotorPin_B, 2000) def motor(): # global pwm_B GPIO.output(MotorPin_A, GPIO.HIGH) GPIO.output(MotorPin_B, GPIO.LOW) time.sleep(3) GPIO.output(MotorPin_A, GPIO.LOW) GPIO.output(MotorPin_B, GPIO.HIGH) time.sleep(3) # pwm_B.start(0) # pwm_B.ChangeDutyCycle(50) # time.sleep(10) def loop(): while True: motor() def destroy(): motorStop() GPIO.cleanup() if __name__ == '__main__': setup() try: loop() except KeyboardInterrupt: destroy()
(My driver board was not available in the diagramming software, so I combined a couple that looked close. Assume the board diagrammed is the board in the pololu link.)