Case 8- Base move

Part 1 Objective

User writes a program to achieve that when the mBot starts, the mBot moves forward, backward, turns left and right in turn, and finally stops moving.

79656d4f-1983-405e-be06-710fafaaf398.gif

 

Part 2 Preparation

  • mBot x1
  • USB cable x1
  • Computer with network access
  1. Use a data cable to connect the mBot to the computer.

f5532864-2690-499c-89dc-ebf2bc2e1cb3.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".

59ad7932-92bd-4c20-9880-a527e1583f79.png

 

Part 3 Programming

User uploads the program to make the mBot stop moving after going forward, backward, left, and right turns.

fa6e0d97-4317-4875-a4a5-76be71acd7ce.gif

Source program diagram

f40bf228-44d4-4f77-8df1-def45e872ad3.png

 

Part 4 Procedure source code

move.mblock

 

Part 5 Practice

  1. Modify the movement time value in the blocks to make the mBot go further.
  2. Try other motion module blocks and observe the operation effect of mBot.
Was this article helpful?
1 out of 1 found this helpful

Comments

0 comments

Please sign in to leave a comment.