mBot - Basic Loops

Materials

1 mBot

1 tablet with mBlock app

Step  1 : Connect the mBot to the tablet and open the programming interface

Use the dedicated button in the upper right-hand corner to connect to the mBot

Step  2 : Repeat an action

In the "Control" tab, look for block that allow to repeat an action. In programming, this is called loops.

Step  3 : Use a loop

  • First play a simple sound with the mBot, followed by a break of 1 second.
  • Play this sound 5 times with a loop
  • Use the same loop to make the mBot go right and left alternatively

Step  4 : Exercises

Do 5 times the following actions :

  • turn on right LED and then go right (and then stop and turn LED off)
  • turn on left LED and then go left (idem)

Do 5 times the following actions:

  • turn on right LED during 0.5 second and play a sound
  • turn it off during 1 second in silence.