Extension—Upload Mode Broadcast

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 cable to connect mBot to your computer.

2. Click the Devices tab and click + add 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.

1596705097940-42b4085e-8dfd-4231-aecb-949d13e931e9.gif

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.

1596705098575-4f5fe885-c022-47dd-b38f-7c9df23592f8.gif

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.

1596705098241-5b28b290-fe11-4d5d-9a34-61e4a11e910c.gif


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.

1596705097640-0911fa87-30b2-41b3-bb3b-c1c02e200115.gif

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 color ( ) to the Scripts area, and keep the default red color.

1596705097971-e0e971a9-769e-42d8-bc8b-0c13a123657f.gif

5. Click Upload to upload the program to mBot.

1596705098595-839a6ddf-81bd-48ac-98f3-7c7c1c7b02ac.gif

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

1596705869023-a9bc1e6f-46a1-43f9-9d9a-88753e3f009b.gif

1596705098276-0cf1770d-1a0e-4e21-ae64-7d763b753685.jpg

Was this article helpful?
2 out of 4 found this helpful

Comments

0 comments

Please sign in to leave a comment.