TurtleBlock Studio

Python for kids with blocks

Free ($0) is the block builder and the Pico W simulator. Standard ($30/month) adds ESP32, Raspberry Pi, Makeblock, USB upload, and .py downloads. Premium ($50/month) adds online project saves.

TurtleBlock Studio lets you snap Blockly blocks and read the code they create. On a Raspberry Pi Pico W or an ESP32 that code is MicroPython. On a Raspberry Pi or a Makeblock Auriga it is Python you copy and run on a computer. No account is needed. Your blocks stay in this browser.

Blocks first, code beside them

A block is one instruction you can see. A forever block keeps going. A wait block pauses. An onboard LED block turns the light on the Pico W on or off. You do not have to type those lines to start. The studio writes them while you snap the blocks together.

The code sits in a panel next to the blocks. For Pico W the heading says Generated MicroPython for Raspberry Pi Pico W. There is a Copy button. The same words are a good way to learn what Python looks like, because each block has a matching line.

There is also a Code view. Sync from Blocks fills that editor with the code from your blocks. Convert to Blocks goes the other way. It asks "This will replace your current blocks. Continue?" before it changes the workspace. Say yes only when you are ready to swap the blocks you already built.

  1. Press Open Studio. The studio opens in this browser. No account is needed.

  2. Leave the board on Raspberry Pi Pico W. That choice is the one with a picture simulator.

  3. Open Samples and choose Blink an LED. The blocks repeat forever: onboard LED on, wait 500 milliseconds, onboard LED off, wait 500 milliseconds.

  4. Read the code panel. The forever block is a while True loop. The onboard LED block writes Pin("LED", Pin.OUT).value(1) for on and value(0) for off. The wait block writes time.sleep_ms(500).

  5. Press Copy if you want those lines on the clipboard. The studio also adds from machine import Pin, PWM, ADC and import time at the top, even when a small blink does not use PWM or ADC.

  6. Open the Code view and press Sync from Blocks. The editor shows the same program. Press Convert to Blocks only when you want the studio to rebuild blocks from that text.

  7. To try another board, pick ESP32, Raspberry Pi, or Makeblock (Auriga on Python Host) in the board list, then read the panel again. The heading changes when the language changes.

MicroPython the blink blocks create

from machine import Pin, PWM, ADC
import time

while True:
    Pin("LED", Pin.OUT).value(1)
    time.sleep_ms(500)
    Pin("LED", Pin.OUT).value(0)
    time.sleep_ms(500)

What those words mean

while True means "keep doing the lines inside." Pin("LED") is the light built onto the Pico W, not a light you wire yourself. value(1) turns that light on. value(0) turns it off. time.sleep_ms(500) waits 500 milliseconds, which is half a second. Change 500 to 100 if you want the sample tip of a quick strobe, then read the panel again. The number in the code follows the number on the block.

ESP32 uses the same kind of MicroPython panel. The picture simulator is still the Pico W simulator, so practice the blink there, then connect a real ESP32 with USB in Chrome or Edge. The ESP32 guide says that in more detail.

Raspberry Pi shows Python (Host Runtime) for Raspberry Pi. You copy that Python and run it in Thonny or the terminal on the Pi. This website does not sign in to the Pi. The Raspberry Pi guide walks through that copy-and-run path. Makeblock uses a different Python file that talks to an Auriga controller. Read the Makeblock guide before you run a robot.

A safe way to learn the words

Read one block, then the line it made, then the next block. You are checking that the story matches. If a line surprises you, click the block and look at its tooltip. Do not paste a long program from the internet into Convert to Blocks and expect every line to become a block. The converter understands the patterns the studio uses. A line it cannot turn into a block stays as a warning, or it may not appear as the block you hoped for.

Your project stays in this browser. There is no online class folder. Refresh the page and the browser recovery draft can bring the blocks back. Loading a sample replaces the workspace, so copy anything you want to keep before you open a new sample.

Common questions

Is this the same as typing Python?

You can read the Python and you can edit it in the Code view. The usual path is still blocks. Sync from Blocks copies the blocks into the editor. Convert to Blocks builds blocks from code after you confirm.

Do I install Python to try the blink?

No install is required to open the studio or to run the Pico W simulator. A real Pico W or ESP32 connects with USB in Chrome or Edge. Raspberry Pi and Makeblock Python run on that computer, not inside the web page.

Will Convert to Blocks erase my work?

It replaces the blocks after you confirm. If you want to keep the current blocks, choose not to continue, or copy the code first.

Which Python do I get?

Pico W and ESP32 show MicroPython. Raspberry Pi and Makeblock (Auriga on Python Host) show host Python. The panel heading names the board you picked.

More guides

Start Here: Open Studio