Robotics with mBot #5

Follow-up of my previous articles (firstsecondthird, and fourth) about my experience hosting a robotic class in a junior high school. Here is a little wrap-up of the fifth session.

Theme of the day

This session was mostly a follow-up of the previous session. The idea was to continue working on the LED matrix and remote controls. Some of the kids were busy with another activity so we were only half of the usual troupe. So the session was much simpler to host!

Loops and Variables in Led Matrix

In the previous session, some kids started to draw animation in the Led Matrix. This time I tried to drive them to use “show drawing” at a specific position (x, y) using For loops and Variables so show the drawing at different positions (instead of drawing every single “frame” of their animation). That worked well for a couple of groups, which then could show it to other groups. The results were easy to demonstrate to other kids, so it was quite successful.

Common mistake

In the report of the session #3, I mentioned some common mistake that kids were doing (no looping, no waiting). Another one that comes over and over is that kids forget to come back to an initial state. For example, here is a typical program they would come up with:

Their expectations is that the left LED will be red for 1 second, and then the right LED will be red for one second, and so on. So that should do a sort of an infinite right-left blinking. What happens in fact is that both LEDs quickly become red and stay red…. The program should set the LED back to their initial state if we want the blinking to happen:

This notion of “initial state” is also a source of many bugs when developing Led Matrix or mouvements programs. I guess they will lean by practise!




Leave a Reply

Your email address will not be published. Required fields are marked *