1.3 Quick Guide on PictoBlox

Required Components

In this project, we need the following components.

It’s definitely convenient to buy a whole kit, here’s the link:

Name

ITEMS IN THIS KIT

LINK

ESP32 Starter Kit

320+

ESP32 Starter Kit

You can also buy them separately from the links below.

COMPONENT INTRODUCTION

PURCHASE LINK

ESP32 WROOM 32E

BUY

ESP32 Camera Extension

-

Breadboard

BUY

Jumper Wires

BUY

Resistor

BUY

LED

BUY

Now let’s learn how to use PictoBlox in two modes.

Also build a simple circuit to make this LED blink in 2 different modes.

../../_images/1_hello_led_bb.png

Stage Mode

1. Connect to ESP32 Board

Connect your ESP32 board to the computer with a USB cable, usually the computer will automatically recognize your board and finally assign a COM port.

../../_images/plugin_esp32.png

Open PictoBlox, the Python programming interface will open by default. And we need to switch to the Blocks interface.

../../_images/0_choose_blocks.png

Then you will see the top right corner for mode switching. The default is Stage mode, where Tobi is standing on the stage.

../../_images/1_stage_upload.png

Click Board in the upper right navigation bar to select the board.

../../_images/1_board.png

For example, choose ESP32.

../../_images/1_choose_uno.png

A connection window will then pop up for you to select the port to connect to, and return to the home page when the connection is complete. If you break the connection during use, you can also click Connect to reconnect.

../../_images/1_connect.png

At the same time, ESP32 related palettes, such as ESP32, Actuators, etc., will appear in the Block Palette.

../../_images/1_arduino_uno.png

2. Upload Firmware

Since we’re going to work in the Stage mode, we must upload the firmware to the board. It will ensure real-time communication between the board and the computer. Uploading the firmware it is a one-time process. To do so, click on the Upload Firmware button.

After waiting for a while, the upload success message will appear.

Note

If you are using this board in PictoBlox for the first time, or if this board was previously uploaded with the Arduino IDE. Then you need to tap Upload Firmware before you can use it.

../../_images/1_firmware.png

3. Programming

  • Open and run the script directly

Of course, you can open the scripts directly to run them, but please download them from github first.

You can click on File in the top right corner and then choose Open.

../../_images/0_open.png

Choose Open from Computer.

../../_images/0_dic.png

Then go to the path of esp32-starter-kit-main\scratch, and open 1. Stage Mode.sb3. Please ensure that you have downloaded the required code from github.

../../_images/0_stage.png

Click directly on the script to run it, some projects are click on the green flag or click on the sprite.

../../_images/1_more.png
  • Program step by step

You can also write the script step by step by following these steps.

Click on the ESP32 palette.

../../_images/1_arduino_uno.png

The LED is controlled by the digital pin 26 (only 2 states, HIGH or LOW), so drag the [set digital pin out as] block to the script area.

Since the default state of the LED is lit, now set pin 23 to LOW and click on this block and you will see the LED go off.

  • [set digital pin out as]: Set the digital pin to (HIGH/LOW) level.

../../_images/1_digital.png

In order to see the effect of continuous blinking LED, you need to use the [Wait 1 seconds] and [forever] blocks in the Control palette. Click on these blocks after writing, there is a yellow halo means it is running.

  • [Wait 1 seconds]: from the Control palette, used to set the time interval between 2 blocks.

  • [forever]: from the Control palette, allows the script to keep running unless manually paused.

../../_images/1_more.png

Upload Mode

1. Connect to ESP32 Board

Connect your ESP32 board to the computer with a USB cable, usually the computer will automatically recognize your board and finally assign a COM port.

../../_images/plugin_esp32.png

Open PictoBlox and click Board in the top right navigation bar to select the board.

../../_images/1_board.png

For example, choose ESP32.

../../_images/1_choose_uno.png

A connection window will then pop up for you to select the port to connect to, and return to the home page when the connection is complete. If you break the connection during use, you can also click Connect to reconnect.

../../_images/1_connect.png

At the same time, ESP32 related palettes, such as ESP32, Actuators, etc., will appear in the Block Palette.

../../_images/1_upload_uno.png

After selecting Upload mode, the stage will switch to the original code area.

../../_images/1_upload.png

2. Programming

  • Open and run the script directly

You can click on File in the top right corner.

../../_images/0_open.png

Choose Open from Computer.

../../_images/0_dic.png

Then go to the path of esp32-starter-kit-main\scratch, and open 1. Upload Mode.sb3. Please ensure that you have downloaded the required code from github.

../../_images/0_upload.png

Finally, click the Upload Code button.

../../_images/1_upload_code.png
  • Program step by step

You can also write the script step by step by following these steps.

Click on the ESP32 palette.

../../_images/1_upload_uno.png

Drag [when ESP32 starts up] to the script area, which is required for every script.

../../_images/1_uno_starts.png

The LED is controlled by the digital pin26 (only 2 states HIGH or LOW), so drag the [set digital pin out as] block to the script area.

Since the default state of the LED is lit, now set pin26 to LOW and click on this block and you will see the LED go off.

  • [set digital pin out as]: Set the digital pin to (HIGH/LOW) level.

../../_images/1_upload_digital.png

At this point you will see the code appear on the right side, if you want to edit this code, then you can turn Edit mode on.

../../_images/1_upload1.png

In order to see the effect of continuous blinking LED, you need to use the [Wait 1 seconds] and [forever] blocks in the Control palette. Click on these blocks after writing, there is a yellow halo means it is running.

  • [Wait 1 seconds]: from the Control palette, used to set the time interval between 2 blocks.

  • [forever]: from the Control palette, allows the script to keep running unless the power is off.

../../_images/1_upload_more.png

Finally, click the Upload Code button.

../../_images/1_upload_code.png