Wait Program!
Students work as engineers to write programs in which their LEGO robots respond to clapping hands and human touch.Copyright (left) Eirik Refsdal, Wikimedia Commons; (right) Evan-Amos, Wikimedia Commons
http://commons.wikimedia.org/wiki/File:Lego_Mindstorms_Nxt-FLL.jpg
http://commons.wikimedia.org/wiki/File:Hands-Clapping.jpg
After completing the associated lesson, students test their understanding in two programming tasks that utilize LEGO® MINDSTORMS® NXT robots and sound/touch sensors. In the first challenge, students become acquainted with wait blocks by designing programs to simply make robots move forward until "hearing" a noise, and then turn left. The second, more challenging activity pushes students to fully understand the potential of wait blocks. They create programs that make the robots change speed several times when a touch sensor is pressed. Students gain practice in the iterative design-program-test-redesign process. A PowerPoint® presentation, pre/post quizzes and worksheet are provided.
**Note: This activity uses the retired LEGO NXT robot which is no longer available for purchase.
Engineers and scientists frequently write programs to assist them in solving problems. Often, these programs perform simulations or mathematical operations to help them analyze the results of many different inputs. As a result, computer programs must be flexible enough to deal with variable conditions, not just one specific case. For example, if programming a calculator, the program must be able to operate on any two numbers that might be entered.
In the first lesson in the unit, the programs were only good for navigating through a maze with precisely the given measurements. In the calculator example, this is analogous to being able to compute 1+2 correctly but not accounting for any other possible inputs. Using wait blocks, we can program robots to account for variable conditions, for instance, to move forward any distance until running into a wall. The skill of designing solutions that can handle a variety of conditions is incredibly useful in engineering and in life.
After this activity, students should be able to:
- Program the LEGO MINDSTORMS NXT robot using sensors to accomplish useful tasks.
- Explain how the wait block functions and provide reasons for using it in programming LEGO robots.
