I even tried the following, bypassing standard accelerometer setup and manually setting the address (it works fine if I comment the OLED piece, but if I keep it it reads 0):
I tried running an i2c scanner. Found that the addresses are the following:
0x19
0x38
0x3C
0x77
I therefore tried using the other library for the OLED, and draw a line with a point depending on the accelerometer value. I selected this low level implementation because it allows me to manually set i2c address. I tried to set in turn all addresses above, and even some random ones, to no avail. The line is drawn, but the accelerometer value read is always 0 (as in other failed experiments)
#include <Arduino.h>
#include "Arduino_SensorKit.h"
#include <U8g2lib.h>
#ifdef U8X8_HAVE_HW_SPI
#include <SPI.h>
#endif
#ifdef U8X8_HAVE_HW_I2C
#include <Wire.h>
#endif
U8G2_SSD1306_128X64_NONAME_F_SW_I2C u8g2(U8G2_R0, /* clock=*/ SCL, /* data=*/ SDA, /* reset=*/ U8X8_PIN_NONE); // All Boards without Reset of the Display
void setup(void) {
u8g2.setI2CAddress(0x77); // trying to set an address to avoid conflict
u8g2.begin();
Accelerometer.begin();
}
void loop(void) {
u8g2.clearBuffer();
u8g2.drawLine(Accelerometer.readX()*100, 10, 40, 55);
u8g2.sendBuffer();
delay(100);
}