I made my first script and is running fine, but i'm confused with running time. In my code
motor (200steps/rev) made 1 rev in 40 seconds. Can somebody explain me why is 40 not 50 sec.?
Code: Select all
import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BOARD) ControlPin = (7,11,13,15) for pin in ControlPin: GPIO.setup(pin,GPIO.OUT) GPIO.output(pin,0) 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(50): for halfstep in range(8): for pin in range(4): GPIO.output(ControlPin[pin], seq[halfstep][pin]) time.sleep(1) GPIO.cleanup()