2 I2C on the Mega?

Hello All,

I am currently stuck trying to get 2 I2C devices to work on the mega. I have a tilt compensated magnetometer hooked up now. That runs through the SDA and SCL pins. I also have a LCD screen that works only through the SDA and SCL too? It just has 4 connectors (GND, VCC, SDA, SCL). Is there any way I can get them to work on the same mega board at the same time? I am having trouble finding solutions online that make some sense to me.

Thanks For Any Help, Keith

Yes if they are both I2C devices you just connect the SDA,SCL and grounds to both dervices to the arduino and then provide power.

Mark

holmes4: Yes if they are both I2C devices you just connect the SDA,SCL and grounds to both dervices to the arduino and then provide power.

Mark

So you basically solder links in between the devices so that both devices are on the same pins? Hows it know what is suppose to go to what?

They have different addresses.

Note the first parameter in Wire.RequestFrom() is the address.

Look up I2C to see hoe it works!

Mark

And to answer your next question, it is on the datasheet.

I like how you guys are thinking ahead and thanks for the tips. I was thinking I would have to use another arduino to communicate but it looks like I won't need to.