BIRS Lab Week 2: Robot Brain

I. Find Limitations When Stimulating a Program

First, Anand and I read the microbit voltage at various locations throughout the circuit board.

II. Program the Brain

After reading the voltage and messing around at different points on the circuit board, we began to explore the features. The first game we installed was Snake. Then, we used the makecode software to design text and images to display on the LED’s and test the limitations. One of my initial observations was that since there are so few LED’s. The options for what can be displayed on the LED’s are pretty limited.. for the most part, to images that have “squared edges”. If you would like to show “round” images, you have to compromise and design them in a pixellated fashion. Displaying text is also a bit of a problem, since the width of the LED array is also quite short. Therefore, it is pretty difficult to read longer words…. you really have to focus your attention and almost read at a dumbed down pace.

II. Use the Sensors

Initially, we wanted to really test the limitations of this brain by connecting two sensors and letting them communicate with one another. This proved to be incredibly difficult and time consuming, so we shifted our focus.

Our next mission was to design a game like Space Invaders in which the player attacks and shoots alien, with the “ammo” represented by the LED’s moving across the array. We related this game design to real life as rivaling species and animal communities often quarrel and attack each other. Essentially, survival of the fittest. We wanted to design the game such that the “brain” can be used like a game pad or controller, using buttons A and B to control. 

One issue we ran into with this coding, namely using function is.pressed(), was that on each button press, the cursor would move erratically rather than just moving one space. Like this:

After a long time spent troubleshooting, we decided to try using was.pressed() instead, which actually worked. At this point, we were able to get the cursor to only move one space on each button press. Here is the video of our code working. 

Leave a Reply