What it is: The MPU9250 is a 9-axis IMU — accelerometer, gyroscope AND magnetometer. The added magnetometer lets it work out a real compass heading and full orientation, which the MPU6050 can't.
How it works: I2C device at address 0x68. The library reads all nine axes and can compute yaw/pitch/roll. Shares SDA/SCL with the OLED. This sketch shows acceleration and the yaw (heading) angle.
Wiring (shared I2C bus with the OLED):
MPU9250 SDA -> GPIO4
MPU9250 SCL -> GPIO5
MPU9250 VCC -> 3V3
MPU9250 GND -> GND
OLED VCC=3V3, GND=GND, SDA=GPIO4, SCL=GPIO5
Libraries: "MPU9250" by hideakitai, plus "Adafruit SSD1306" and "Adafruit GFX Library".
On screen / Serial: acceleration X and the yaw angle in degrees. Rotate the board flat to watch yaw sweep 0–360°.
Gotchas: Many cheap "MPU9250" boards are actually MPU6500 (no magnetometer) or the newer ICM-20948 — yaw won't work on those. For accurate heading, calibrate the magnetometer by rotating the board in a figure-8 at startup. Address 0x68.