6. Darts


This time, we won’t be throwing darts, but we’ll let the mBot count the points.
Get ready and concentrate... “Throw your mBot” and get your points.
You have 40 minutes to program your robot.

You'll learn how to:

  • program different buttons on the remote control.

What you need



Before you can start, you need to set the court. You can choose between course 1 and course 2.
You start with 150 points. From this, you subtract the scored points. The first person to have 0 points, wins.

To do:

  • Start before the line, on the mark, and direct your mBot.
  • Determine the distance and let the mBot drive.
  • You are not allowed to control the mBot using the remote. You can only use the remote to let the mBot drive forward with one click of the button. The mBot has to stop on its own.
  • You get 40 minutes to write the program and to optimise it.


Giving the buttons an assignment

This exercise is a variation on lesson 2. You can use the code you wrote during this class.
But this time, you have to program multiple distances on your remote. We used buttons 1 to 9 for this.
We also used the arrows so the mBot could move from left to right before the start.

This way, we can direct the mBot before sending it off.

You can use part of the code from lesson 5.

We won’t show the complete code. Tailor your program and above all, test it out!!!


  • Test out different distances as much as you can.
  • Write down the different distances on a piece of paper. This way you’ll know what button to press for a certain distance.



You can add as many assignments as you’d like. We’ll list a few, but try to use your imagination

  • Add more pieces of paper with penalty points on them.
  • Create pieces of paper with x2 or x3. If your mBot successfully stops on this kind of paper and then continues onto a different piece of paper, then your score doubles or triples.
  • ...


Have fun!!