1. Purpose of the Case
Program the CoCube robot to implement the LED display function of the LCD screen.
2. Materials Used
3. Software Platform
4. Start Programming
The CoCube robot is equipped with a full-color LCD screen that can display content in different ways. The most basic display method is through a 5×5 block array. To light up the CoCube, follow these steps:
Connect the Device: Connect the MicroBlocks IDE and the CoCube robot via wired or wireless means.
Find the Blocks: Find the "Display" block in the "LED Display" block library and drag it to the workspace.
Run the Program: Left-click the block. When a green halo lights up around the block, it means the program has been successfully executed, and you can observe that the LCD screen of the CoCube robot is displaying a smiley face.
Display and Clear: To clear the current pattern on the screen, you can use the "Clear Display" block. Click the "Clear Display" block directly in the block area, or drag the "Clear Display" block to the workspace and click it, and all content on the screen will be cleared.
Reference Code Example: MicroBlocks - CoCube Case 01 Display and Clear
5. Challenge: Flowing Lights
In the "LED Display" library, you can control each LED block individually using the "Light up x _ y _" and "Turn off x _ y _" blocks. Refer to the blocks below and try to write a flowing lights program!
You can try changing the wait time to control the speed of the flowing lights; you can also try using the "Hat Block" - for example, "When Button A/B is Pressed" to set different display colors for the flowing lights.
Reference Code Example: MicroBlocks - CoCube Case 01 Flowing Lights