What do you get when you combine some circuitry, an electronic circuit board, coding know-how, and tinkering skills together?
A dancing robot, of course! Our fourth graders embarked on a brand new robotics and programming unit this year. They assembled their own circuits with servos, attached them to Adafruit’s Circuit Playground Express (named after the first computer programmer, Ada Lovelace), and housed the entire setup in a cardboard box for the body of the robot. Using Microsoft’s MakeCode, the students coded their robots to perform dances – complete with lights and sounds!
In coding, we learned about an important computer programming principle called DRY: “Don’t Repeat Yourself”. In first and third grade, our students learned how to use loops to “DRY up” their code. In fourth grade, our students learned about the powerful use of functions.
Functions are containers for code or sets of instructions that can be called upon in the main program. We first declared and defined functions to make the servos (and the wheels attached to them) move in various different directions. Then the students created dance functions whereby they called on the movement functions. Some students accidentally discovered that you can have a function call itself (i.e., recursion). But let’s not get too complicated!
After declaring and defining their dance functions, students learned about events and event handlers. Event handlers take in input and cause an event to happen. With the Circuit Playground Express, students can use the light and sound sensors, as well as buttons, to cause an event (i.e., dance) to occur by calling the dance function using the even handler.
Before spring break, the students tested out and debugged their programs! [Do you know where the terms computer “bug” and “debugging” come from? Ask a fourth grader! They’ll tell you about Grace Hopper, a very important figure in computer history.]
After spring break, fourth graders were as busy as bees in the MakerSpace in the school library, putting the extra finishing touches on their dancing robots. You can see their handiwork in the display cases right outside the MakerSpace.
Here are some photos of our robotics work!