August 2010
Intermediate to advanced
288 pages
13h 21m
English
The Switch block is used to make decisions about which blocks to run by choosing between two or more alternatives. For example, the WallFollower program in Chapter 7 uses a Switch block that reads the Ultrasonic Sensor and decides whether to move the TriBot toward or away from the wall. In this chapter, you’ll learn how to use the Switch block to make decisions using a value supplied by a data wire, instead of using data directly from a sensor. You’ll also learn how to pass data between the blocks inside the Switch block and the ones that come before or after the Switch block.
The Control setting on the Switch block’s Configuration Panel offers two choices: Sensor and Value. ...