from machine import Pin, PWM import time p0 = Pin(16, Pin.OUT) p1 = Pin(5, Pin.OUT) p2 = Pin(4, Pin.OUT) p3 = Pin(0, Pin.OUT) A = 0 B = 1 while True: if B == 1: if A == 0: p0.value(0) p1.value(0) p2.value(0) p3.value(0) elif A == 1: p0.value(1) p1.value(0) p2.value(0) p3.value(0) elif A == 2: p0.value(0) p1.value(1) p2.value(0) p3.value(0) elif A == 3: p0.value(1) p1.value(1) p2.value(0) p3.value(0) elif A == 4: p0.value(0) p1.value(0) p2.value(1) p3.value(0) elif A == 5: p0.value(1) p1.value(0) p2.value(1) p3.value(0) elif A == 6: p0.value(0) p1.value(1) p2.value(1) p3.value(0) elif A == 7: p0.value(1) p1.value(1) p2.value(1) p3.value(0) elif A == 8: p0.value(0) p1.value(0) p2.value(0) p3.value(1) elif A == 9: p0.value(1) p1.value(0) p2.value(0) p3.value(1) if A == 9: A = 0 else: A+=1 time.sleep(2)