After spending tons of time on figuring out how to arrange loops in loops, Justin and I realized the complexity of our previous project is far beyond our imagination and capability. We do not want present unfinished product for our midterm project. Thus we decide to switch to another project. In this way, we can at least show a complete work at the presentation.
In the new project, we tried to imitate territorial behavior of some animals. One of the most typical territorial animal is tiger. The following video shows how tigers fight for territory.
Basically we are going to imitate the behavior through remote control. One micro:bit will work as controller and control our tigerbot from distance. The tigerbot can make movement, give out sound of threatening and fearing under control. We achieve the coding part through the MakeCode.
Code for Controller:
Code for Tigerbot:
Display of Movement Function:
Micro:bit has built-in acceleration sensors. It can sensor the change of g on different axis. Through inclining micro:bit, we can change g on different axis. Once acceleration sensors sense these changes, the controller micro:bit will send out signal through radio function. The micro:bit on tigerbot will receive the signal and move the tigerbot.
Display of giving out sound of threatening and fearing:
By pressing button A and B on the controller micro:bit, we can control the tigerbot to give out different sounds.
Sound of threatening:
Sound of fearing:
Remarks:
1. The new project still has a lot of places for improvement. For example, all the actions of tigerbot is controlled by us. We may write code to calculate the rate of hurt and give out sound of fearing automatically in the further project.
2. The previous project is not totally abandoned. We have kept what we achieved so far and it might be used in the future projects.