I2C Communications with Arduino
If I have read correctly, each device has a different I2C address, and you can use them in the same port, but I wasn't sure. If that is possible, how do you know what the address is or how to assign the address?


In an I2C peripheral, a slave address is hard-wired1 inside of the chip.  In some peripherals, some bits of the slave address can be set by strapping address select pins.  The latter allows assigning distinct addresses to several slave devices of the same type, and they can appear on the same I2C bus without causing an address collision.  The definitive source of information on I2C address selection is the datasheet for the slave device.

Let's take MMA8452Q for example.  The addresses are specified in the Table 1  of the datasheet (rev.9).  In addition, Sparkfun talks about the address selection jumper in their Hookup guide.

1 If the slave device itself is a microcontroller, then the address is usually set in its firmware.


  Is there a maximum limit of I2C devices that an Arduino can handle?


All 7-bit addresses should be greater than 0x07 and less than 0x78 (here's a nice chart of I2C addresses).  An Arduino can talk to all of these addresses.  Furthermore, the number of slave devices can be increased by having multiple I2C buses, and through bus switching.

Another limiting factor is total capacitance of I2C bus.  A good conservative approach is to keep the capacitance below 400pF.  More details here.


  Finally


If you are planning to work with I2C, you should read the I2C bus specification.  At least, skim through it.