an ADXL345 and IMU9252 are connected to an arduino pro mini through i2c bus. both modules have different addresses.
so i should change i2c address in slave(arduino) continuously to access both modules data.
I need to know how is it possible and if there is any standard solution to manage this situation?
P.S: I'm using RTimulib for mpu9252 and sparkfun for ADXL345.
so i should adopt the solution regarding to these libraries.
Assuming you are using the standard Arduino Wire library, you need to use
beginTransmission
to begin an I2C transaction:Just put the correct device address as the argument to that function.