Programming Codey Rocky with mBlock 5

 

mceclip2.png

 

This page describes how to use mBlock 5 to program Codey Rocky.

1. Download and install the required software

2. Connect Codey Rocky to mBlock 5

3. Start programming Codey Rocky

When using mBlock 5, you can refer to the following tips:

4.1 Example programs

4.2 Block help

4.3 Learn Python based on blocks

 

1. Download and install the required software

To program Codey Rocky with mBlock 5, you can use the mBlock 5 PC client, mBlock 5 on the web, or the mBlock 5 mobile app.

PC client

To use the mBlock 5 PC client, you need to download and install it. 

mBlock 5 for Windows

mBlock 5 for Mac

 

On the web

To use mBlock 5 on the web (https://ide.mblock.cc), you need to download and install mLink 2.

mLink2 for Windows

mLink2 for Mac

mLink for Chromebook

 

Note:
Google Chrome is recommended. To download Google Chrome, click Google Chrome.

 

Mobile app

To use mBlock 5 on mobile devices, use your phone or tablet to scan the QR code or search for "mBlock" in app stores to download the app.

mBlock-5-mobile.png mceclip0.png

2. Connect Codey Rocky to mBlock 5

Before programming Codey Rocky, you need to connect it to mBlock 5.

Refer to the following instructions according to your mBlock 5 version:

mBlock_5icon.png Connect Codey Rocky to the mBlock 5 PC client

(1) Use a Micro USB cable to connect Codey to your PC, and power on Codey.

mceclip1.png

(2) Double-click the mBlock 5 icon on your PC to open it.

mceclip2.png

(3) On the Devices tab, click + add, select Codey, and click OK.

mceclip3.png

(4) Click Connect to connect Codey to mBlock 5.

mceclip4.png

A message is displayed after Codey is connected, indicating that the connection is successful.

mceclip5.png


 

mlink-icon.png Connect Codey Rocky to mBlock 5 on the web

(1) Use a Micro USB cable to connect Codey Rocky to your PC, and power on Codey.

mceclip1.png

(2) Double-click the mLink 2 icon on your PC to open it.

mceclip6.png

(3) Click Create now in the mBlock block-based editor area to open mBlock 5 on the web.

mceclip7.png

(4) Click the Devices tab, click + add, select Codey, and click OK.

mceclip3.png

(5) Click Connect to connect Codey to mBlock 5.

mceclip4.png

A message is displayed after Codey is connected, indicating that the connection is successful.


 

mBlock-5-mobile.pngConnect Codey Rocky to the mBlock 5 app on your mobile device

(1) Enable Bluetooth on your mobile device.

(2) Turn on Codey.

mceclip8.png

(2) Open the mBlock 5 app on your mobile device, and tap Coding.

mceclip9.png

(3) Tap +, select Codey, and tap .

mceclip10.png

(4) Tap Codey, tap Connect, and put your phone or tablet close to Codey Rocky.

mceclip11.png

mBlock 5 searches for Codey through Bluetooth and connects to it.

mceclip12.png

(5) Tap Back to coding.

3. Start programming Codey Rocky

Now, you can start to program Codey Rocky by dragging blocks to the scripts area on the right!

Start from a simple project: When you press button A on Codey, it says "Hello!"

(1) Set the programming mode.

mBlock 5 provides two programming modes, namely Live and Upload. You can click to switch the modes.

mceclip3.png

Live: In this mode, you can execute the blocks in real time, which helps you find out whether the program you've written works. In this mode, you must keep Codey connected to mBlock 5. If they are disconnected, the program can't be executed.

Upload: In this mode, you need to upload the compiled program to Codey. After being successfully uploaded, the program can still run properly on Codey when it is disconnected from mBlock 5.

In this project, set the programming mode to Upload.

(2) Drag the block "when button () is pressed" from the Events category to the scripts area, and select button A from the drop-down list box.

mceclip1.png

(3) Drag the block "play sound ()" from the Speaker category to the scripts area, and select the sound "hello."

mceclip2.png

(4) Click Upload to upload the program to Codey.

mceclip4.png

 

Now, try pressing button A on Codey!

 

4. Tips for using mBlock 5

4.1 Example programs

You can learn how to use some blocks designed for Codey Rocky through example programs.

On mBlock 5, choose Tutorials > Example Programs and click Codey Rocky to view example programs provided for Codey Rocky.

mceclip0.png

4.2 Block help

If you don't understand a block when using it, you can right-click it and click Help that appears.

mceclip1.png

4.3 Learn Python based on blocks

mBlock 5 provides two programming languages for Codey Rocky, namely block-based programming and Python. In Upload mode, you can click the buttons on the right to switch the programming languages.

mceclip2.png 

In addition, when programming Codey Rocky in Upload mode, you can click the switching button on the right to view the corresponding Python statements (obtained by converting the blocks).

mceclip3.png

 

 

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.