Author: Yisong Xu, Si Xu

The onboard LED light blinks red for 1 second and then turn off for 1 second.Repeated this process for 10 times.

Hardware requirements:

mBot/mCore Control Panel


Upload the program to Arduino

Example program download:



Effect demo
mblock example


Example programs
mblock example


Script description

mblock example Figures represent the brightness; the larger the figure is, the more brightness it represents (range 0~255).
mblock example When the color parameters are 0, the LED light is off.
mblock example Use “wait” block to control the red time and off time of the onboard LED light (keep the status of the previous block without proceeding to the next). Different time can be set to control the blink frequency of the LED light.
mblock example “Repeat” block means to repeat the contained script. This block is used to control the blink frequency.

Knowledge points
What if we delete the two  block in the example?
As the program is uploaded to Arduino, it runs very fast, even quicker than the duration of vision (about 0.05s). If you delete , the main control board will run quickly the program “turn on and off the LED red light”, but you cannot see it blinking with your eyes. To see the blinking, you need to add a waiting time at the end of the script that controls the on and off of the LED light.
Please compare the following scripts and their effects:

Script Effects
(please upload the program to Arduino)
 mblock example Repeat it for 10 times and the LED light will be turned on and off. You cannot even see the blinking (the script runs in a blink).
 mblock example Repeat it for unlimited times and the LED light is kept on (the script runs continually and your eyes cannot capture the blinking).

Extended tasks

Task 1 Change the sample scripts to keep the onboard LED blinking (you need to upload the program to the Arduino).
Task 2 Change the sample scripts to increase the blinking frequency of the onboard LED (you need to upload the program to the Arduino).


Attached-mCore main control board LED diagram
mblock example


This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

—— More examples