Communicationg with multiple LSM303DLHC's chips (soft i2c?)

Hello, this is my first post on here so please be patient. I am working on a project that will use two LSM303DLHC’s to find relative angles.

The problem I have come across is that the i2c slave addresses are not programmable on these chips and thus there can be only one per i2c bus. (please correct me if I am wrong here)

I have looked into a work around for this and have come up with either implementing soft i2c and having two separate buses, or using a multiplexer to switch between the two slave devices.

Could someone please let me know which direction would be easier to implement and have less trouble down the line.

Thanks

Update: Sorry I didn’t mention it. I’m using an arduino MEGA. I have downloaded the soft i2c library but have not implemented it yet.

Hello,

What microcontroller are you using? I think the answer will depend on whether there is already a software I2C implementation you can use instead of writing your own, and how comfortable you are programming that microcontroller vs. working with multiplexer circuits.

- Kevin

I’m using an Arduino Mega.

I don’t have any experience with software I2C libraries on Arduino, but a quick Google search presents several choices, so there’s a good chance you should be able to find something that works. In particular, this one claims to support communicating with multiple devices simultaneously.

- Kevin