Program Devices with mBlock 5

mBlock 5 can be used to program hardware devices as well as sprites.

This section uses HaloCode as an example.

Connect a Device

(1) Use a USB data cable to connect the device to a computer.

Note:
If a device is equipped with a power switch, ensure that the device is turned on.

(2) Open mBlock 5, click add and choose your device in the Device Library dialog box the appears.

Note:
To use mBlock 5 on the web, you need to run mLink first.

(3) Click Connect.

(4) In the dialog box that appears, use the serial port identified by mBlock 5 and click Connect.

(5) After the device is connected, Device connected is displayed.

Make your Device Move

The block area displays various types of blocks, and you can use them to implement various effects.

Now, try to complete the following task: When you press the blue button on HaloCode, all the LED indicators on it are on in red.

(1) Drag the Events block when button is pressed to the Scripts area.

(2) Drag the Lighting block all LEDs light up ( ) to the Scripts area.

(3) Press the blue button on HaloCode. Are all the LED indicators on in red?

results matching ""

    No results matching ""