Sie sind auf Seite 1von 1

Lesson 4

from Myro import *

This is a simple brain program which allows my robot to detect a line


(like a line of permanent marker) and follow it.
def followLine():
while True:
left, right=getLine()
print (left, right)
if (right==1 and left==1):
motors(-0.5,-0.45)
elif (right>left):
motors(1,-1)
elif (right<left):
motors(-1,1)
else:
forward(0.5,0.3)

Das könnte Ihnen auch gefallen