Hardware requirements:

mBot/mCore Control Panel

Implementation:

Upload the program to Arduino

Effect demo

 

Example programs

 

Script description

Define Variable  as the brightness value of the red light of the onboard LED.
Set the initial value of Variable  as 0, and then the onboard LED is initially off.
Set the varied value of Variable  and the brightness increases by 1 each time
Avoid excessively fast change of the red light. Wait to control its changing speed.
You can adjust the number “60” here and set the maximum brightness the onboard Led can achieve.

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