I have changed all to 3V3, pin 1 to PwmA and PwmB and Pin 17 to Vcc (digital side of the TB6612) but not works. Also I have probed with this code but not works -->
RPistepper
Only this code move 1 step (i think), It makes a noise like a blow, when the script ends too:
Code: Select all
#!/usr/bin/env python
# Import required modules
import time
import RPi.GPIO as GPIO
# Declare the GPIO settings
GPIO.setmode(GPIO.BOARD)
# set up GPIO pins
GPIO.setup(12, GPIO.OUT) # Connected to PWMA
GPIO.setup(15, GPIO.OUT) # Connected to AIN2
GPIO.setup(11, GPIO.OUT) # Connected to AIN1
GPIO.setup(13, GPIO.OUT) # Connected to STBY
GPIO.setup(18, GPIO.OUT) # Connected to BIN1
GPIO.setup(16, GPIO.OUT) # Connected to BIN2
GPIO.setup(32, GPIO.OUT) # Connected to PWMB
# Drive the motor clockwise
# Motor A:
GPIO.output(11, GPIO.HIGH) # Set AIN1
GPIO.output(15, GPIO.LOW) # Set AIN2
# Motor B:
GPIO.output(16, GPIO.HIGH) # Set BIN1
GPIO.output(18, GPIO.LOW) # Set BIN2
# Set the motor speed
# Motor A:
GPIO.output(12, GPIO.HIGH) # Set PWMA
# Motor B:
GPIO.output(32, GPIO.HIGH) # Set PWMB
# Disable STBY (standby)
GPIO.output(13, GPIO.HIGH)
# Wait 5 seconds
time.sleep(5)
# Drive the motor counterclockwise
# Motor A:
GPIO.output(11, GPIO.LOW) # Set AIN1
GPIO.output(15, GPIO.HIGH) # Set AIN2
# Motor B:
GPIO.output(16, GPIO.LOW) # Set BIN1
GPIO.output(18, GPIO.HIGH) # Set BIN2
# Set the motor speed
# Motor A:
GPIO.output(12, GPIO.HIGH) # Set PWMA
# Motor B:
GPIO.output(32, GPIO.HIGH) # Set PWMB
# Disable STBY (standby)
GPIO.output(13, GPIO.HIGH)
# Wait 5 seconds
time.sleep(5)
# Reset all the GPIO pins by setting them to LOW
GPIO.output(11, GPIO.LOW) # Set AIN1
GPIO.output(15, GPIO.LOW) # Set AIN2
GPIO.output(12, GPIO.LOW) # Set PWMA
GPIO.output(13, GPIO.LOW) # Set STBY
GPIO.output(16, GPIO.LOW) # Set BIN1
GPIO.output(18, GPIO.LOW) # Set BIN2
GPIO.output(32, GPIO.LOW) # Set PWMB