Code: Select all
def function1():
totalSteps = 1000
stepsDone = 0
while (switch == 1 or stepsDone <= totalSteps):
for x in range(0,4000):
GPIO.output(10,GPIO.HIGH)
if (switch ==0):
break
if (stepsDone==totalSteps):
break
GPIO.output(26,GPIO.HIGH)
time.sleep(.0008)
GPIO.output(26,GPIO.LOW)
time.sleep(.0008)
stepsDone=stepsDone+1
GPIO.output(10,GPIO.LOW)
stepsDone =0