How Do You Make a Program Wait?
Students are introduced to how sensors may be used in programming.Copyright (left, right) 2004 Microsoft Corporation, One Microsoft Way, Redmond, WA 98052-6399 USA. All rights reserved;
http://office.microsoft.com/en-us/images/results.aspx?qu=computer&ex=1#ai:MP900448599|
Building on the programming basics learned so far in the unit, students next learn how to program using sensors rather than by specifying exact durations. They start with an examination of algorithms and move to an understanding of conditional commands (until, then), which require the use of wait blocks. Working with the LEGO® MINDSTORMS® EV3 robots and software, they learn about wait blocks and how to use them in conjunction with move blocks set with unlimited duration. To help with comprehension and prepare them for the associated activity programming challenges, volunteer students act out a maze demo and student groups conclude by programming LEGO robots to navigate a simple maze using wait block programming. A PowerPoint® presentation, a worksheet and pre/post quizzes are provided.
Programming is a vital skill for most engineers as well as many other professional jobs. Almost all useful programs must be able to perform operations without knowing all of the values of operands in advance. For instance, in a program that plays chess against a human player, the computer does not know where its opponent is going to move in advance, but is programmed to be able to respond to a variety of situations. Similarly, a LEGO robot does not know exactly how far away an obstacle is, but it can be programmed to bypass the obstacle when it is sensed.
After this lesson, students should be able to:
- Program a LEGO MINDSTORMS EV3 robot using sensors.
- Explain why it might be advantageous to program a LEGO robot without having to know exact distances it must move.
