1 . Plan
On start, Justin and I tried to build a reverse version of the shadow-fearing robot, which is a light fearing robot. When the vehicle is set down in a dark or dim room, it drives straight forward until the light sensor senses high intensity light. Then left motor of the vehicle will stop. In this way, the vehicle will veer. It will start turning again until the light sensor no longer sense high intensity light. However, when will try to achieve this behavior by using python, we find out there is no code for calling the light sensor in the library. Another way of achieving this behavior through python is using external sensors, but it is beyond our capability.
Thus, we decide to try to achieve another behavior, which is wall follower. However, since we don’t have whisker brick, we have to redesign the logic of the behavior by replacing whisker brick with microwave unit. But we found out that it needs at least two microwave unit to realize the behavior. We have to give up this plan.
After spending most of time with achieving nothing, we decided to at least make something. Thus we decided to use MakeCode to achieve the shadow seeker behavior. The main part we used is Line Follower Unit. We interpret the black line as shadow and the vehicle will automatically drive on the black line.
2 . The completed code is shown below.
3. Implementation
4. Something more
After doing some research, I find out the Kittenbot to some extent is a small version of sweeping robot. Modern sweeping robots usually have microwave sensors or infrared sensors, a basic part of line follower unit, to sense obstacles and veer. It is interesting to see that these robots with very simple behaviors have already become an important part of our daily life.
It enlightens me that I may combine the microwave unit and line follower unit to conduct some more complicated behaviors. However, only several pins have read function. Most ones only can write. I may have to give up some functions of these units. Thus, how should I implement complicated behaviors needs more thinking.