Exercise 14 - WefaaRobotics/Smorphi GitHub Wiki

Items needed:

  • An assembled Smorphi mini / Smorphi 2 robot
  • Wefaa InfraRed (IR) sensor
  • A computer
  • A USB to USB-C cable
  • Internet connection
  • Black tape
  • Opaque items to be used as obstacles

Objectives of exercise:

  1. Combination of lesson 7 and 8
  2. Reinforced learning about code priority

Steps Description
1 [Detect obstacles and follow the line at the same time]

Now that we have found out how to make Smorphi follow the line and also detect obstacles, let's combine these 2 functions together in an exercise. Your goal is to get your Smorphi to follow the line, and also be able to stop when there are obstacles in front of it.

2 [Set up the line and space]

Set up the line like in exercise 8. Alternatively, if you wish to design your own line, you can go ahead too. Then, place some obstacles on the line to block the way of your Smorphi. Make sure your obstacles are opaque and light coloured so that it is easier for your Smorphi to detect the obstacles.

Try out your code as many times as you need to achieve the goal.

3 [For Blockly users]

Once you are done, you can compare your solutions here!

4 [For Arduino/C++ users]

Once you are done, you can compare your solutions here!

5 [Challenge yourself]

What if you want your Smorphi to go around the obstacle instead, and then resume following the line after the obstacle? Is that possible with the current set of sensors you have been provided? If not, what other sensors you will need?

Go ahead and explore different ways to arrange things, post on social media, and tag #Smorphiexperiments

⚠️ **GitHub.com Fallback** ⚠️