from microbit import * display.off() pin8.write_digital(0) # 1 pin9.write_digital(0) # 2 pin10.write_digital(0) # 3 pin12.write_digital(0) # 4 speed = 5 while True: if button_a.get_presses(): # full step mod for n in range(12): pin8.write_digital(1) # 1 pin10.write_digital(1) # 3 sleep(speed) pin8.write_digital(0) # 1 pin10.write_digital(0) # 3 pin8.write_digital(1) # 1 pin12.write_digital(1) # 4 sleep(speed) pin8.write_digital(0) # 1 pin12.write_digital(0) # 4 pin9.write_digital(1) # 2 pin12.write_digital(1) # 4 sleep(speed) pin9.write_digital(0) # 2 pin12.write_digital(0) # 4 pin9.write_digital(1) # 2 pin10.write_digital(1) # 3 sleep(speed) pin9.write_digital(0) # 2 pin10.write_digital(0) # 3 if button_b.get_presses(): # half step mod for n in range(12): pin8.write_digital(1) # 1 pin10.write_digital(1) # 3 sleep(speed) pin8.write_digital(0) # 1 pin10.write_digital(0) # 3 pin8.write_digital(1) # 1 sleep(speed) pin8.write_digital(0) # 1 pin8.write_digital(1) # 1 pin12.write_digital(1) # 4 sleep(speed) pin8.write_digital(0) # 1 pin12.write_digital(0) # 4 pin12.write_digital(1) # 4 sleep(speed) pin12.write_digital(0) # 4 pin9.write_digital(1) # 2 pin12.write_digital(1) # 4 sleep(speed) pin9.write_digital(0) # 2 pin12.write_digital(0) # 4 pin9.write_digital(1) # 2 sleep(speed) pin9.write_digital(0) # 2 pin9.write_digital(1) # 2 pin10.write_digital(1) # 3 sleep(speed) pin9.write_digital(0) # 2 pin10.write_digital(0) # 3 pin10.write_digital(1) # 3 sleep(speed) pin10.write_digital(0) # 3