CHAPTER 13I2C Bus Communication

The I2C bus is a powerful feature of the NXT because it provides the NXT with practically unlimited expansion capability. Although it's located on the input port connector, it's actually used for expanding both inputs and outputs. Only two wires are necessary because the data is transmitted serially, or one bit at a time. One wire is sending and receiving data (SDA), and the other is providing a clock (SCL). On the input port connector, SDA is pin 6 and SCL is pin 5, or blue and yellow in the NXT cable. You need a third wire for ground, which is either pin 2 or 3, black or red in the NXT cable.

Note The original NXT firmware had some problems with I2C communications, so make sure you're running at least version ...

Get Extreme NXT: Extending the LEGO MINDSTORMS NXT to the Next Level now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.