from machine import Pin, Timer
from time import sleep
def motor (ap,bp,am,bm,ret):
a1.value(ap),b1.value(bp),a2.value(am),b2.value(bm)
sleep(ret)
a1=Pin(23,Pin.OUT)
a2=Pin(21,Pin.OUT)
b1=Pin(22,Pin.OUT)
b2=Pin(19,Pin.OUT)
while(True):
# a+,b+,a-,b-,ret
motor(1, 1, 0, 0, 0.2)
motor(0, 1, 1, 0, 0.2)
motor(0, 0, 1, 1, 0.2)
motor(1, 0, 0, 1, 0.2)