Robotics 3 – mBot Extention

OK, now it’s time to try some new sensors and mBot customization.

Challenge 1

Program the RGB lights so that they turn different shades of colors depending on how much light is hitting the sensor. Remember that you can’t make it too bright or you will interfere with the light sensor!

When done, take a screenshot of your code. Crop down to just the code, please. Put your name on it and hand it in.

Challenge 2

Code a program that works as follows:

  1. The robot will wake up in the dark and start moving, not too quickly.
  2. The robot will use its ultrasonic sensor to avoid obstacles.
  3. When a flashlight shines on the bot, it stops.
  4. When the light moves off the robot, it wakes up and starts sneaking around again.

When done, take a screenshot of your code. Crop down to just the code, please. Put your name on it and hand it in.

Challenge 3

Add the 6-legged kit to convert your mBot into a (cute) walking terror-bot.

Assignment – Adjust and fine tune the linkages so that your robot moves smoothly. Then, create a program that does the following:

  1. Robot moves forward 10 hallway tiles.
  2. Robot turns to the left by reversing the left motor and keeping the right motor going forward.
  3. Robot moves forward (now pointing left) 3 hallway tiles.
  4. Robot stops.

Challenge 4

Have the mBot locate an object.

  1. Write a program such that the mBot will scan for and move towards a nearby object.
  2. When it finds the object, the mBot moves towards it, but it must stop before it hits the object.
  3. The mBot may need to re-scan for the object as in moves so that it can fine-tune its path.
  4. Choose a suitable object, such as a water bottle or pop can for the bot to locate.
  5. With the mBot out in the hallway, set an object down in a random location.
  6. This challenge is complete when your robot will find the object and stop 10cm, exactly, in front of it. The mBox must also be facing the object when it stops.

Challenge 5 – Sensors

Here we are going to add a variety of input and output devices to the mBot.

Servos

Connect and use a servo

Final project

  • Robot Baloon battle.
  • Robot hide and seek.
  • Robot find-the thing.