How Can We Help?

Upload Mode Broadcast

FAQs on mBlock 5 Block-based Editor

With the Upload Mode Broadcast extension, you can enable a sprite to interact with a device in Upload mode.

Note: In the default settings, you can enable a sprite to interact with a device only in Live mode after connecting the device to your computer through a serial port.

Let’s use mBot as an example to explore the Upload Mode Broadcast extension.

Connect mBot

1. Use a USB data cable to connect mBot to your computer.

2. Click the Devices tab and click + to add mBot from Device Library.

3. Set the mode to Upload.

4. Click Connect. In the dialog box that appears, choose USB and click Connect.

Use the Upload Mode Broadcast blocks

Let’s create a new project to light up the LED indicators of mBot through Panda.

Program Panda

(1) Click the Sprites tab and click + extension at the bottom of the blocks area. On the Extension center page that appears, click + Add at the bottom of Upload Mode Broadcast.

2. Select Panda. Drag the Events block “when green flag clicked” and Upload Mode Broadcast block “send upload mode message ( )” to the scripts area, and name the message light.

Program mBot

3. Select mBot on the Devices tab and click + extension at the bottom of the blocks area. In the Extension center dialog box that appears, click + Add at the bottom of Upload Mode Broadcast.

4. Drag the Upload Mode Broadcast block “when receiving upload mode message ( )” to the scripts area and enter the message name light. Drag the Show block “LED (all) shows ( )” to the scripts area, and keep the default red color.

5. Click Upload to upload the program to mBot.

6. Click the green flag under the stage and see what happens.