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 or array. In the play mode, the Finch will translate the sequence of tilts into a sequence of movements.
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.
- The Finch should record for approximately 30 seconds.
- The robot should record the Finch’s orientation every 0.1 seconds. This orientation should be added to the end of listOfOrientations. You may ignore orientations not listed above.
- When the Finch is in record mode, its beak should be red.
- When the Finch leaves record mode, its beak should turn off (no light).
In this mode, the program should move through listOfOrientations. For each orientation in the list, the Finch should make a movement. The requirements for play mode are listed below.
- The program should move through each item in listOfOrientations.
- 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 program should wait 0.1 seconds between items on the list.
- When the Finch is in play mode, its beak should be green.
When you have a working project, be sure to find some younger students to try it out!
Extension: Play a WAV file during recording and execution so that the children can program the Finch to dance to the music. Make sure to reset the time period for recording and playback to match the length of your song.