Be on the lookout

It is likely that students will think about the touch sensor that is being pressed and immediately released. As a result they may construct a program with two touch event watchers, one watching for a press event, the other for a release (as in the PressRelease program). Intuitively, this makes sense because we press the sensor and then release. But practically, when the program starts running, itís likely that the sensor is released. Therefore, the stack attached to the release event watcher will trigger, even though the sensor has not been pressed.

What you can do: Use the examples provided in Transparency #4. Encourage students to predict the robotís behavior. Note that most students can cite the meaning of a single block. Whatís important here, though, is to help them understand how the program flows and how a command relates to the rest of the program. (e.g., how Off A relates to the On AC command in the Main Program).


 An important distinction: When this program starts, the ďReleaseĒ is the true condition. Therefore, the program is going to carry out the block in the Main Program and the stack in the release branch. This program will only produce behavior similar to the PressOnly program above if the touch sensor is pressed and released as soon as the the program starts. Otherwise, it will turn and go backwards and continue to go backwards even though it didnít bump into anything.


Close Window