from machine import Pin
from time import sleep
mot11=Pin(0, Pin.OUT)
mot12=Pin(4, Pin.OUT)
mot21=Pin(18, Pin.OUT)
mot22=Pin(19, Pin.OUT)
for i in range(1,10,1):
voice=input("Enter your speech word :")
if voice=="forward":
mot11.on()
mot12.off()
mot21.on()
mot22.off()
print("robot moving forward")
elif voice=="backward":
mot11.off()
mot12.on()
mot21.off()
mot22.on()
print("robot moving backward")
elif voice=="right":
mot11.on()
mot12.off()
mot21.on()
mot22.off()
print("robot turning right")
elif voice=="left":
mot11.off()
mot12.on()
mot21.off()
mot22.on()
print("robot turning left")
elif voice=="stop":
mot11.off()
mot12.off()
mot21.off()
mot22.off()
print("robot standly")
else:
print("Invalid command!")
sleep(1)