ESP32 IoT Future Board Kittenblock Programming Tutorial 04 - Turtle Graphics

ESP32 IoT Future Board Kittenblock Programming Tutorial 04 - Turtle Graphics

Turtle graphics is an introductory tool for many children who just started to learn to program. We have written it into the Future board, so you can also experience turtle graphics on the screen by programming with Kittenblock.

 

  Programming Blocks

Block

 Introduction

1 turtle color

Set the color of the turtle brush

2 turtle forward

Turtle brush moves forward

3 turtle left 90 degree

Turtle brush turns left

4 turtle right 90 degree

Turtle brush turns right

5 turtle heading 90 degree

Set the orientation angle of the turtle brush

6 turtle go to x y

The turtle brush moves to a specific coordinate position

7 turtle set x 100

The turtle brush moves to the x-coordinate position, while the y-coordinate remains unchanged

8 turtle set y 100

The turtle brush moves to the y-coordinate position, while the x-coordinate remains unchanged

9 turtle circle radius 20 degree 360

Draw circles with the turtle brush (set the radius and angle of the circle)

10 turtle draw dot size 5

Use the turtle brush to draw the origin (the parameter is the set size)

11 turtle begin fill

When drawing a closed figure, and you want to fill it, you need to place this block at the beginning

12 turtle end fill

When drawing a closed figure, and you want to fill it, you need to place this block at the end

13 turtle pen down

The turtle brush can draw after the brush is down

14 turtle pen up

After the turtle brush is lifted, the brush won't draw even if you move the mouse

15 turtle clear

Clear the screen

 

 

 Example

📋: Lines and logic

20 lines and logic

 

📋: Draw a five-pointed star

21 draw a five-pointed star

 

📋: Draw a leaf

22 draw a leaf

 

 Because the pixels on the hardware do not meet the pixel requirements of the actual turtle drawing, it is not recommended to fill in color

 

If you have any question, please feel free to contact us at Discord, we will always be there to help.

 

KittenBot Team

Leave a comment

Please note, comments need to be approved before they are published.

SUBHEADING

Blog posts