Program xLight with the mBlock App

mceclip0.png

This page describes how to program xLight with the mobile mBlock app.

1. Preparation

2. Get or update the mBlock app

3. Connect xLight to the mBlock app

4. Program xLight

5. Switch between the user-defined program and default program

1. Preparation

Before you start, make sure that you've got:

  • A tablet or smart phone

image.png or image__1_.png

  • xLight

mceclip3.png  or  mceclip4.png  or mceclip5.png

If you haven't assembled your xLight, see Assemble xLight to assemble it and connect it to a power supply.

2. Get or update the mBlock app

Use your mobile device to scan the following QR code to get or update your mBlock app.

mBlock-5-mobile.pngqrcode-ios-cn.png

Alternatively, search for mBlock in an app store to download or update it.

3. Connect xLight to the mBlock app

(1) Turn on Bluetooth on your smart device.

set_bluetooth.png

(2) Tap to open the mBlock app.

mBlock-5-mobile.png

(3) Tap Coding, and tap + on the page that appears.

add_device.png

(4) In the sprite library, choose Devices > xLight and tap .

mceclip0.png

(5) Tap the xLight setting icon and tap Connect on the Device setting page.

mceclip1.png

(6) Place the smart device close to xLight.

mBlock 5 automatically searches for and connects to xLight.

mceclip2.png

After the connection is complete, a voice message is played, indicating that the connection is successful.

4. Program xLight

(1) Tap Back to coding.

(2) Set the coding mode.

mBlock 5 provides two coding modes, namely Upload and Live.

Live: In this mode, you can execute the program you've written in real time. During program execution, you must keep xLight connected to mBlock 5.

Upload: In this mode, you need to upload the program to xLight before you execute it. You don't have to keep xLight connected to mBlock 5 during program execution.

For example, set the coding mode to Upload.

mceclip0.png

(3) Drag blocks to the scripts area. 

For example, we can write a simple program to light up the LEDs of xLight assembled with the wooden base and keep changing the brightness of the LEDs.

mceclip5.png

Note:

If you program xLight assembled with the LED strip or LED string, use the blocks in the LED Strip  or LED String category.

mceclip9.png 

(4) Click the Upload icon to upload the program to xLight.

mceclip3.png

After you upload the program to xLight, xLight lights up the LEDs in red and the brightness keeps changing.

 

Note: The control box of xLight can store only one user-defined program. A new program you upload to it replaces the last one. 

 

5. Switch between the user-defined program and default program

You can switch between the default program and user-defined one by continuously pressing the button three times.

mceclip10.png

For details about the default program, see Default Program of xLight.

 

More information

Default Program of xLight

Control xLight with Its Button

Control xLight with the Remote Control

Control xLight with the Makeblock App

Program xLight with mBlock 5 on Your PC

 

 

 

 

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

Comments

0 comments

Please sign in to leave a comment.