- Three key concepts in for programming are: think in steps, reuseability, and loops
- Recruit a parent to be a “robot”
- Use a whiteboard or large sheet of paper to reinforce concepts visually
- Left foot forward and right foot forward can be combined together as a STEP command block
- Re-use the STEP command block multiple times throughout the exercise
- Multiple STEP commands in succession can be put in a loop
Before you let your kids even touch a robot, there are some key concepts they need to grasp:
- Thinking in steps like a computer
To teach these three concepts, I enlist the help of a parent. I have the kids give the parent instructions to accomplish a task I have set out for them. Demonstration is always a more effective teaching tool than lecturing. It gives your kids a visual reinforcement to the words you’re telling them. And when you let them participate, it makes them think and it makes it fun. Especially when they can tell an adult what to do.
Also use a large whiteboard or large piece of paper to diagram the robot commands. This will mimic the programming interface your kids will use later to program their real robot.
The task I set up for them entails having the parent start in a corner of the room, follow a path (that includes one left turn, one right turn and a straight away), close an open laptop, and return back to the starting point. My path goes from the corner of my family room, forward 2 full steps, a right turn, forward 5 full steps, a left turn, forward one full step to the laptop sitting partially open on a counter, moving an arm down to close the laptop, and going back.
Your parent will have three “motors” just like the robot for the competition. One motor will be for the left leg, one motor for the right leg, and one for the closing arm that moves up and down.
Start by asking the kids what the “robot” should do first. They’ll probably say something like, “move forward.” But the robot doesn’t understand that command. How does the robot “move forward?” The answer they should come to is that they have to move one leg forward, then the other. You’ve now got them to break down abstract concepts like “move forward” into basic steps. They should begin to understand that computers, or robots, only understand steps like these, so they need to think in steps, too. More of this will come during the exercise.
Now that the robot has moved both legs, you can group those two commands into a single command block called a STEP. Once the STEP command block is built, the kids can use that block again to tell the robot to “move forward.” By using the block over and over again, they now know what reuseability is.
In my path, there is now a right turn. The kids need to recognize that this is the left foot taking two or three steps in succession without the right foot moving. This is how the robot will turn. They could also move the left foot forward while moving the right foot backward. That is more of a pivot turn (and harder for the parent to execute). This again teaches the kids to think like a robot, breaking an abstract idea of TURN RIGHT into steps. This TURN RIGHT command could also become a command block to be used later.
The next section is 5 forward STEPs. The kids will probably add 5 STEPs in succession. Here is where the last concept comes in. A loop is a construct in programming that allows you to repeat a command until a certain condition is met. In this case, the condition is to repeat until the command has been executed 5 times.
They now do a LEFT TURN (right foot forward two or three steps while the left foot stays still), and forward one STEP. Now they’ll try to close the laptop, but they forgot a step. If the robot is at the laptop and they try to move the closing arm up, the counter will be in the way, right? They should have moved the arm up before taking the step forward. Have them back up one step (left leg backward one, right leg backward one – they can save this as a BACKWARD STEP command). Now they can move the arm up, but how far? They should think in degrees. Most kids at this age know a full circle is 360 degrees, so have them figure out how many degrees to move the arm up (probably about 135).
Now take the forward STEP to get the arm over the laptop and issue a down command to close the laptop (the laptop should not fully be open to make the close action easier). Make sure they define the right number of degrees. If they over shoot, the robot should be lifting its wheels (the parent’s feet) off the ground just like the real robot would do.
Your kids should now be able to reuse command blocks to return the robot back to its starting point. The clever kids will notice that the 5 STEP loop could also be put into its own command block of STRAIGHTAWAY to be used a second time for the return.
This entire process will probably take about an hour and a half to two hours. I hope I described this process in enough detail for you to understand it enough to teach your team. If you need any clarification, let me know.