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:
- The robot will wake up in the dark and start moving, not too quickly.
- The robot will use its ultrasonic sensor to avoid obstacles.
- When a flashlight shines on the bot, it stops.
- 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:
- Robot moves forward 10 hallway tiles.
- Robot turns to the left by reversing the left motor and keeping the right motor going forward.
- Robot moves forward (now pointing left) 3 hallway tiles.
- Robot stops.
Challenge 4
Have the mBot locate an object.
- Write a program such that the mBot will scan for and move towards a nearby object.
- When it finds the object, the mBot moves towards it, but it must stop before it hits the object.
- The mBot may need to re-scan for the object as in moves so that it can fine-tune its path.
- Choose a suitable object, such as a water bottle or pop can for the bot to locate.
- With the mBot out in the hallway, set an object down in a random location.
- 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.
- Click here for the assignment document: Challenge 5 Input Output
Servos
Connect and use a servo. Mr. E will hand out servo kits and we will learn how a servo is different from a motor.
Final project
We have a choice of wrap-up activities:
- Robot Balloon battle.
- Robot hide and seek.
- Robot find-the thing.
- Robot Laser-tag