How to select alternate I2C address in code?
Hi,
I have 2 SEN0373 boards that I need to connect to the same Arduino, and read from both.
I can connect one without problem, and individually they both work fine.
Now I have shorted the address selector on one of them, to change the I2C address from 0x68 to 0x69, and connected them both to the same I2C bus.
I cannot figure out how to select the secondary sensor on address 0x69? I assume that I need to create two bmx objects, with something like:
--------------
#include <DFRobot_BMX160.h>
DFRobot_BMX160 bmx160_a; // first device in default address
DFRobot_BMX160(&Wire, 105) bmx160_b; // Second device on alternate address 0x69h = 105d
-------------
But I get a lot of errors about wrong data types…
Can you please show me how I set the correct address?
BR Casper.
Hi!
Sorry, the library of this sensor uses 0x68 by default. It is recommended that you refer to the library file of another product and modify the library file of SEN0373.Product wiki: https://wiki.dfrobot.com/Gravity_I2C_LIS2DW12_Triple_Axis_Accelerometer_SKU_SEN0409Library: https://wiki.dfrobot.com/Gravity_I2C_LIS2DW12_Triple_Axis_Accelerometer_SKU_SEN0409
jenna