

The Atmega328 is configured to use internal pull-up resistors which may be adequate for short cable runs. These pins may require pull-up resistors (that is, connect them to +5v via something like a 4.7K resistor each). They are also connected to D2 (SDA) and D3 (SCL). On the Arduino Leonardo, the SDA and SCL pins are separate pins, so marked, on the board (next to AREF). On the Arduino Mega, SDA is digital pin 20 and SCL is digital pin 21 (they are marked SDA and SCL on the board itself). Analog port 5 (A5) = SCL (serial clock).On the Arduino Uno the pins you need are: More information about the Arduino Two-Wire interface at: Address 0 is reserved as a "broadcast" address, addresses 1 to 7 are reserved for other purposes, and addresses 120 to 127 are reserved for future use.īecause of this you could have an LCD screen (say) at address 10, a keyboard at address 11, and so on. Each device needs to have a unique address in the range 8 to 119. This is because the devices are "addressable". The Two-Wire interface is extremely useful for connecting multiple devices, as they can all share the same two pins (plus a ground return). A lot of the details however will be of more general interest. This post describes how the I2C (Inter-Integrated Circuit, or "Two-Wire") interface works, with particular reference to the Arduino Uno which is based on the ATmega328P microprocessor chip. This page can be quickly reached from the link: A summary of everything shown below is available further down this page:
