Case 1 - Lights Flash

Part 1 Objective

The user writes the program and uploads it to mBot so that mBot has basic lighting capabilities.

Part 2 Preparation

  • mBot x1
  • USB cable x1
  • A computer connected to a network
  1. Use a data cable to connect mBot to the computer

d360a64c-6f95-4bcc-ac2a-6295c1b4416c.gif

  1. Open MBlock5 (PC, Web, APP), click "Add" in the lower left device area, select mBot in the device library, and click “Connect”.(Live mode: you can click the building block to observe the real-time running effect, but you need to keep the data cable connected to the computer; Upload mode: You can upload the program to mBot, at which time you can unplug the data cable to run the program.), this course needs to switch to "Upload mode".

17c5b71e-ddec-40c4-be65-290b25df38a0.gif

 

Part 3 Programming

After the user uploads the program to mBot, the LED lights of different colors flash alternately by repeating execution of the program to produce brilliant and colorful light flickering effects.
d2b96693-a2e4-4433-be41-f1b7764cecfe.gif
Source program diagram

3ba8a258-dfff-40b9-b2ff-d31acf884e9a.png

 

Part 4 Procedure source code

Course 1_Light Flicker.mblock

 

Part 5 Practice

  1. Change the duration of the light.
  1. Modify the color of the light.
  1. Increase/decrease the variety of light colors.

 

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

Comments

0 comments

Please sign in to leave a comment.