Cannot communicate with FXOS8700CQ sensor over I2C
Posted: Mon Nov 27, 2017 9:43 pm
Hello all,
I'm fairly new to working with I2C, so bear with me if I am a little slow in figuring things out.
I have an ESP-32S WROOM32 module and I'm trying to read accelerometer/magnetometer values from a FXOS8700CQ. The sensor is on the The NXP Precision 9DoF breakout board (from Adafruit). I added 2 pullup resistors (9k) to the SCL and SDA lines. The example code for reading the FXOS8700CQ sensor from an Arduino works nicely. Previously I had been using a ADXL345 sensor connected in the exact same manner to the ESP and it worked perfectly. I tried to adapt that code to work with the FXOS8700CQ, and that's where I'm stuck. Somehow, when I write the address of the FXOS8700CQ to the bus for the first time (sensors.c, in the initACC() function, attempting to set up the sensor range, power state, etc), it's incorrect or somehow the sensor was not initiated properly. I don't think the address is wrong, but I'm not sure what is. What am I doing wrong?
I'm fairly new to working with I2C, so bear with me if I am a little slow in figuring things out.
I have an ESP-32S WROOM32 module and I'm trying to read accelerometer/magnetometer values from a FXOS8700CQ. The sensor is on the The NXP Precision 9DoF breakout board (from Adafruit). I added 2 pullup resistors (9k) to the SCL and SDA lines. The example code for reading the FXOS8700CQ sensor from an Arduino works nicely. Previously I had been using a ADXL345 sensor connected in the exact same manner to the ESP and it worked perfectly. I tried to adapt that code to work with the FXOS8700CQ, and that's where I'm stuck. Somehow, when I write the address of the FXOS8700CQ to the bus for the first time (sensors.c, in the initACC() function, attempting to set up the sensor range, power state, etc), it's incorrect or somehow the sensor was not initiated properly. I don't think the address is wrong, but I'm not sure what is. What am I doing wrong?