Introduction to micro:bit microturtle extension library
While browsing the makecode website, you may find a very interesting extension library-Turtle, which is a micro:bit extension library that is used to control a LED highlight, and then control its movement through programming, we can also draw the movement track to create complex graphics, there is limited by the size of the dot matrix on the micro:bit board, there are not many complex graphics that can be drawn, but it is still worth a try. Below is a spiral I drew:
We will show you the basic functions and usage of this extension in this blog.
Why Turtle ?
Turtle is an extension library inspired by an ancient programming language-Logo. Note that it is not Lego. Logo is a programming language dedicated to education. Its main function is to draw Turtle Graphics. Turtle graphics can be considered to use programming commands to control the crawling trajectory of a little turtle, and then repeat it continuously to draw ever-changing graphics.
Add the extensions:
1.Go to MakeCode editor: https://makecode.microbit.org/ to create a new project.
2.Click “Advanced” to see more choices and click “Extensions”.
3.Click microturtle to add it in the new project we just created.
4.You can see a new item-turtle in the drawer now.
There are two modules that control the number of moving steps---forward and back, forward means forward movement, back means backward movement, and the number in the module represents how many steps to move.
By default, the direction of movement of the turtle is upwards, forward means to move one led up; back means to move one led down.
Turn left and turn right.
“Set position” and “home”，set position brick is able to set the X and Y axis; home means to put it in the middle(2,2) on the screen.
There is only one module for setting the pen, pen down makes the tortoise crawl and leave a track and the led lights on, and pen up makes the tortoise crawl without the track.
The brightness setting module is used to control the brightness of the led lights when the tortoise is crawling. The range is 0-255, with 255 being the brightest. If set to 0, it means that there is no track as pen up.
The speed setting module is used to control the moving speed of the turtle.
If you have any ideas or opinions, please feel free to contact us via email@example.com.
Share this post
About the Author
ELECFREAKS focuses on microbit and publishes interesting articles
- Micro bit supplier
- Wholesale Suppliers
- Micro bit tutorial
- Micro bit classroom pack
- Mcorbit Environment Monitoring
- TPBot car
- Micro:bit car
- AI Lens
- Micor:bit AI Lens
- Microbit gyroscope
- Micro:bit LEDs
- BBC micro:bit
- Micro:bit Manipulator
- Wukong board
- Micro:bit Motorcycle
- Nezha breakout
- Micro:bit DIY
- 360° servos
- AI Lens
- Retro Arcade
- Microbit programming
- Do your:bit
- Rainbow LED Ring
- Wonder Building Kit