Programming with Gestures

In this project, you will create a way for young children to program the Finch. The Finch will have two modes. In the recording mode, a child can tilt the Finch in different directions. Your program will save this sequence of tilts in a list. In the play mode, the Finch will translate the sequence of tilts into a sequence of movements.

Record Mode

First, write a script that will control the Finch when it is in record mode. In this mode, the user will tilt the Finch in different directions (Beak Up, Beak Down, Left Wing Down, Right Wing Down, and Level). Your goal is to record this sequence of tilts in a list called listOfOrientations. The requirements for record mode are listed below.

  1. The record mode should start when the user presses the ‘r’ key.
  2. At the beginning of the record script, listOfOrientations should be set to an empty list.
  3. In record mode, the robot should record the Finch’s orientation every 0.1 seconds. This orientation should be added to the end of listOfOrientations.
  4. The Finch should remain in record mode until the user presses the spacebar.
  5. When the Finch is in record mode, its beak should be red.
  6. When the Finch leaves record mode, its beak should turn off (no light).

Play Mode

Next, write a script that will control the Finch when it is in play mode. The script for this mode should move through listOfOrientations. For each orientation in the list, the Finch should make a movement. The requirements for play mode are listed below.

  1. The play mode should start when the user presses the ‘p’ key.
  2. The script should move through each item in listOfOrientations.
  3. The Finch orientations (Beak Up, Beak Down, Left Wing Down, Right Wing Down, and Level) should correspond to different movements of the robot. For example, Level should correspond to stopping the Finch. You should make the other four orientations correspond to these four Finch movements: forward, back, turn right, and turn left. You may choose which orientation corresponds to each movement. The robot should do nothing for the Upside Down and In Between orientations.
  4. The repeat block should include a 0.1 second wait.
  5. When the Finch is in play mode, its beak should be green.
  6. When the Finch leaves play mode, its beak should turn off (no light).

When you have a working project, be sure to find some younger students to try it out!

Extension: Choose new movements to correspond to different tilts of the Finch, or maybe you would prefer to add lights and sound to your program. Use your imagination!

Grades: 
Activity Level: