BMX160+BMP388 Address Problem
Hi,
im using the BMX160+BMP388 to get some data about wavemovements.
I also use an RTC DS3231 (0x68). The default address of the BMX160 ist 0x68 and I physically changed it to 0x69.
With the RTC connected, the sensor getting bad data. If i disconnect the RTC, the BMX160 is not initialising.
I think its initialising on the address 0x68. I tried to change the i2C address in the headerfile but the problem is still there.
How can I solve this problem?
Many thanks for your answers.
Best regards
Max Steinkamp
Hello,
thank you for your answer. I scanned it and this is the output (not welded):
Scanning...
I2C device found at address 0x68 !
I2C device found at address 0x76 !
done
If i weld it to change the address its:
Scanning...
I2C device found at address 0x69 !
I2C device found at address 0x76 !
done
So its changing but while initialising its only working for 0x68. I need to make it work with 0x69.
Much thanks
Max-Luca.SteinkampYou can try to change this address in the DFRobot_BMX160.h file to 0x69
Hello,
Have you tried to use an I2C scanning program to check the changed I2C address? If you are using Arduino IDE, you can try the following code.
#include <Wire.h> // Include the Wire library for I2C communication
// Setup function initializes the serial communication and I2C
void setup() {
Serial.begin(9600); // Initialize serial communication with a baud rate of 9600
Wire.begin(); // Initialize the I2C communication
Serial.println("Start I2C address scan"); // Print a message to indicate the scan is starting
}
// Loop function continuously scans for I2C devices
void loop() {
byte device_address; // Variable to store the I2C device address
int nDevices; // Variable to store the number of devices found
// Search for devices on the I2C bus
nDevices = Wire.scan(); // Perform the scan and store the number of devices found
// Print the number of devices found
Serial.print("Number of devices found: ");
Serial.println(nDevices);
// Loop through all the devices found
for (int i = 0; i < nDevices; i++) {
// Get the address of the current device
device_address = Wire.getDeviceList();
// Print the device address
Serial.print("Device address: ");
Serial.print(device_address, HEX); // Print the address in hexadecimal format
Serial.println(" (0x"); // Print a prefix to indicate hexadecimal format
}
// Wait for a few seconds before scanning again
delay(5000);
}