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:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |