from machine import Pin
motor1A = machine.Pin(14, machine.Pin.OUT)
motor2A = machine.Pin(15, machine.Pin.OUT)
Button1 = machine.Pin(16, machine.Pin.IN)
def clockwise():
motor1A.high()
motor2A.low()
def anticlockwise():
motor1A.low()
motor2A.high()
def stopMotor():
motor1A.low()
motor2A.low()
while True:
if Button1.value() ==1:
clockwise()
elif Button1.value() ==0:
stopMotor()