Go Down

Topic: How do I give an I2C device an address? (Read 636 times) previous topic - next topic


I have my nice shiny new Arduino Mega and a few I2C devices such as a Tiny RTC and a Temp and Humidity sensor.  I have read lots about the I2C interface and I think I understand it with the exception of the device address.  Does one assign a device an address (and if so, how does one do that?) or is the device address hard wired into the device in which case how do I read it?

Many thanks for any help


The easiest thing to do is look at the datasheet, this ought to tell you everything you need to know. Some modules have fixed addresses, some have software controlled addresses, some have hardware controlled addresses (where you have a set of pins that determine the address). Datasheets can be very cryptic and it can be a bit of a pain finding what you want, but a search for "address" should help you find what you want.



Thank you Toby - I guess I just have to dig a little deeper.



Does one assign a device an address

the device manufactuers assign the addresses.

If you code your own slave, you can make it whatever you want.


you can make it whatever you want

... as long as it is unique for the I2C implementation on your project. It should be clear that all devices have unique addresses for a specific implementation.
Arduino Libraries http://arduinocode.codeplex.com
Parola for Arduino http://parola.codeplex.com
Arduino++ blog https://arduinoplusplus.wordpress.com

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131