1. Purpose of the Case

Program the CoCube robot to achieve synchronized processes using broadcasting.

2. Materials Used

CoCube Robot × 1 Personal Computer or Tablet

3. Software Platform

MicroBlocks-CoCube

4. Start Programming

In previous lessons, we primarily dealt with sequential structures, where programs execute instructions in a predetermined order. However, in practical applications, we often encounter situations where multiple tasks need to run simultaneously. In such cases, the broadcast feature becomes particularly important. This case will explain how the broadcast feature triggers signals and how to use this mechanism to achieve parallel execution of two program components.

  1. Connect Device: Connect the MicroBlocks IDE to the CoCube robot via a wired or wireless connection.

  2. Find Blocks: Open the "Control" block library and locate the "when received" and "broadcast" blocks. Drag them into the workspace as shown in the image. The broadcast function is implemented through these two blocks.

  • Run Program: Using the broadcast feature, you can control the CoCube robot's movement and LED display in parallel. Run the following two programs and experience the difference brought by the broadcast feature.

5. Challenge

You’ve probably encountered a sprinkler truck in real life. When it's working, it sprays water while emitting sounds to alert nearby pedestrians to move away. Let’s try simulating the operation of a sprinkler truck.

Reference Example Program: MicroBlocks——CoCube Case 06 Sprinkler Truck

CC-BY-SA

© by CoCube 2024-2025.

This work is licensed under a CC-BY-SA 4.0 license.