Programming with Micropython: Turtle

Import FutureBoard Library

Import the Library to make use of its functions.

from future import *

04: Turtle

1. Setting the Pen Color

turtle.fillcolor(color)

Turtle accepts RGB value for color, value range is 0~255. Example: (255,100,0)

2. Moving the Pen Forward

turtle.forward(steps)

Moves the pen forward by the number of steps.

3. Turning the Pen

turtle.left(angle)
turtle.right(angle)

Turns the pen to the left or right by the degree of angle.

4. Setting the Heading

Sets the heading to be the angle.

5. Moves the Pen to a Point

Moves the pen to a point (x,y).

6. Moves the Pen along an axis

Moves the pen to a point on the x or y axis.

7. Draws a Dot

Draws a dot with the diameter of d.

8. Draws a Circle

Draws an arc with the given radius and angle, a 360 degree arc results in a full circle.

9. Sets a Fill Area

Begins and ends the fill area.

10. Sets the Pen Up or Down

11. Clears the Screen

Sample Program

Last updated