"It’s Here! The BFCM Sale of the Year – Grab Your Favorites!"

ecode Star Annulus

Through our last ecode Five-pointed Star project introduction, you must have some understandings on the ecode pen extension, today let’s do a more complicated drawing via the pen extension named Star Annulus, see the picture below:

ecode Star Annulus

Is it amazing? You can achieve it by making amendments on the basis of the code the five-pointed star.

Principle:

Please can think it by yourself and here is a tip by slowing the Gif and you may find the principle.

ecode Star Annulus

This figure is actually a combination of two movements, one is to draw a five-pointed star, the other is to turn a circle, first draw a five-pointed star, then turn it by an angle, then draw a five-pointed star, then turn it by another angle, and so on, one after the circle is turned, it becomes this beautiful figure. We have already learned how to draw a five-pointed star in the last project. Let’s turn an angle first, here we choose 15 degrees, and then execute it again, how many times do we need to turn it in total? One turn is 360 degrees, and one turn is 15 degrees, then 360/15=24, which means that you need to turn 24 times, and you just finish one turn, and then draw a five-pointed star for each turn until you finish one turn. Code:

ecode Star Annulus

1.Add another loop to the original that was executed 5 times, and execute it for 24 times

2.Add a sentence below the original loop that was executed 5 times, turn right 15 degrees, or turn left 15 degrees, and you’ve completed it!

Complete code:

ecode Star Annulus

If you have any ideas or opinions, please feel free to contact us via [email protected].

Leave a Reply

images
In March, ELECFREAKS supported 5 schools to carry out school science and technology festival activities
images
Children’s Programming Education is the Future Trend
images
Technical verification! Nezha series products can complete WRO competition tasks
images
Let's take part in the Ceremony of the New Factory of ELECFREAKS together!
images
Bluetooth Bee(HC-05 and HC-06) User Guide
images
In March, ELECFREAKS supported 5 schools to carry out school science and technology festival activities
Monthly Archive