from machine import Pin
import utime
# Define the step pins to control the motors
stepperMin = Pin(5, Pin.OUT)
stepperSec = Pin(17, Pin.OUT)
second = 0
minute = 0
def step(stepper):
if stepper == 1:
counter = 0
while not counter == 53:
stepperSec.on()
utime.sleep(0.001)
stepperSec.off()
counter = counter + 1
else:
counter = 0
while not counter == 53:
stepperMin.on()
utime.sleep(0.001)
stepperMin.off()
counter = counter + 1
while True:
utime.sleep(1)
second = second + 1
step(1)
if second == 60:
minute = minute + 1
step(2)
second = 0
print(second)
print(minute)