August 2010
Intermediate to advanced
288 pages
13h 21m
English
The Switch block in the LogicToText program uses the logic value from the Touch Sensor block to choose between two options. This works great with a logic value because it can have only two possible values (either true or false). But what if you want to choose from more than two options? If so, you’ll need to use either a number value or a text value, since these data types can have more than two values.
When using a number or text value with a Switch block, you create a list of values to match against, one for each choice you want the program to make. Figure 9-15 shows the Configuration Panel for a Switch block that has been configured to choose between three numbers: 10, 25, and 75.
Figure 9-15. Configuration Panel ...