Page 118 -
P. 118
243_MasterPieces_02b.qxd 4/18/03 6:59 PM Page 90
90 Masterpiece 2 • The Learning Brick Sorter
Similarly, a brief impulse to Motor C in the forward direction should lift the arm,
while in reverse direction it should lower the arm. If this doesn’t happen, check the
cabling and the pneumatic tubes.
Bricks & Chips…
Using the Console Mode of the RCX
When you need to test your Learning Brick Sorter, as described in this section,
you can take advantage of the LEGO remote control for the RCX. However, if you
do not have a remote control, you can operate the motors using the console
mode of the RCX.
1. Press the View button until the small arrow on the display points to
the desired output port.
2. Keeping the View button pressed, press the Run button to power the
motor forward or press the Prgm button to power the motor in
reverse.
Programming the Learning Brick Sorter
Before entering the details of the program, I want to explain briefly the strategy we’re
going to use to make our Learning Brick Sorter able to learn. Let’s start describing how
the Learning Brick Sorter is expected to work:
1. The user places a 2x2 brick on the yellow tile of the Pickup Stand sub-assembly,
and then presses any of the two levers of the switchbox to tell the Learning
Brick Sorter to proceed. During this step, the Switchbox sub-assembly is not
used to communicate any feedback, but only to inform the Learning Brick
Sorter that there’s a brick on the Pickup Stand sub-assembly ready to be sorted.
It doesn’t matter which lever the user presses.
2. The Learning Brick Sorter analyzes the color of the brick, looks up the infor-
mation stored in its knowledge base, and decides which bin to drop it in.
3. The Learning Brick Sorter takes the brick and drops it in the chosen Bin sub-
assembly, then waits for a feedback from the user.
4. The user sends his feedback to the Learning Brick Sorter using the Switchbox
sub-assembly, pressing the green lever (if the bin was correct) or the red one (if
the bin was wrong).
5. The Learning Brick Sorter updates its knowledge base with the new informa-
tion, then moves the arm back to the pickup stand for a new cycle.
The key point is the design of the knowledge base obviously. We want our program
to contain the minimal amount of predefined information, because our goal is to make