The onboard LED light blinks red for 1 second and then turn off for 1 second.Repeated this process for 10 times.
mBot/mCore Control Panel
Upload the program to Arduino
|Figures represent the brightness; the larger the figure is, the more brightness it represents (range 0~255).|
|When the color parameters are 0, the LED light is off.|
|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.|
|“Repeat” block means to repeat the contained script. This block is used to control the blink frequency.|
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:
(please upload the program to Arduino)
|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).|
|Repeat it for unlimited times and the LED light is kept on (the script runs continually and your eyes cannot capture the blinking).|
|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
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.