
62 Chapter 4 • Reading Sensors
robot. Let’s create another example to clarify what we mean. Suppose you’re going
to build an elevator.You obviously want your elevator to stop at any floor.Your first
idea is to put a switch at every level, so when one of them closes you know that
the cab has reached that level. Okay, nice approach.There’s one small problem;
however, you have just two touch sensors, and an elevator with only two floors
doesn’t seem like such an interesting project to you.You could buy a third sensor,
but this simply pushes your problem one floor up, without solving the general case.
Meanwhile, the three input ports of your RCX are all engaged. ...