Page 64 -
P. 64

243_Legomaster_01.qxd  4/18/03  6:51 PM  Page 36




           36     Masterpeice 1 • Stair-Climber



                      It is a fairly simple process to modify your Stair-Climber so it is controllable by an
                  RCX. First, you should attach a touch sensor to Input Port A, and second touch sensor to
                  Input Port C, as shown in Figure 1.7.You will then have to modify the Stair-Climber
                  motor wiring as shown.This change connects the left-side motors to Output Port 1 and
                  the right-side motors to Output Port 3.



                   NOTE
                       The wires used for connecting the motors together need to be slightly longer
                       than the ones supplied in the RIS 2.0 set. Use whatever combination of wires
                       you have available to make these connections.




                  Then, by writing a simple program in the language of your choice, assign the following
                  values:

                       ■  Touch Sensor A causes both Output Ports 1 and 3 to be set to ‘reverse’ and ‘on’
                          while pressed.
                       ■  Touch Sensor C causes both Output Ports 1 and 3 to be set to ‘forward’ and ‘on’
                          while pressed.

                       ■  Both Output Ports 1 and 3 are turned ‘off’ when neither Touch Sensor is
                          pressed.

                      A sample program built with the RIS 2.0 language and programming interface would
                  look something like the program seen in Figure 1.8.


                  Figure 1.8 A Sample Stair-Climber Program Built with RIS 2.0
   59   60   61   62   63   64   65   66   67   68   69