attach the wires

It’s easier to add the wires now before you add the final beam. Table 3-1 shows how to connect the motors and sensors to the NXT.

Table 3-1. cable connections

motor or sensor

port

cable length

Motor on the Ultrasonic Sensor side

B

14 inches (35 cm)

Motor on the Color/Light Sensor side

C

14 inches (35 cm)

Touch Sensor

1

8 inches (20 cm)

Sound Sensor

2

14 inches (35 cm)

Color or Light Sensor

3

14 inches (35 cm)

Ultrasonic Sensor

4

20 inches (50 cm)

The motors use ports B and C to match the default settings for the Move Block. Likewise, the NXT-G blocks that use sensors default to the port listed in the table. Any motor or sensor will work using any port (for example, the Touch Sensor works just as well using port 4 as it does using port 2), but using ...

Get The Art of LEGO MINDSTORMS NXT-G Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.