Ejemplo n.º 1
0
m.right(90)

# Pen Control

m.penup()					# Move the pen up

m.pendown()

# Sensors

colliding = m.collideState()		# may be left, right, both or none

# Other functions

m.beep(500)				# Beep for 500 mS (1/2 a second)

m.ping()					# Pings the mirobot for a response

Language

You can use any normal Python statements such as while, try, for, in, if else, return, and others.

Example functions

def draw_polygon(sides, length):	# Draws a polygon with a variable number of sides and length

    angle = 360/sides
    for i in range(sides):
        m.forward(length)
        m.right(angle)