#include #include MPU6050 mpu(Wire); void setup() { Serial.begin(9600); Wire.setSDA(D4); // Explicitly set SDA to D4 Wire.setSCL(D5); // Explicitly set SCL to D5 Wire.begin(); byte status = mpu.begin(); Serial.print("MPU6050 status: "); Serial.println(status); while (status != 0) { Serial.println("MPU6050 not connected. Check wiring."); delay(1000); } Serial.println("MPU6050 ready."); delay(1000); } void loop() { mpu.update(); Serial.print("Angle X: "); Serial.print(mpu.getAngleX()); Serial.print(" | Y: "); Serial.print(mpu.getAngleY()); Serial.print(" | Z: "); Serial.println(mpu.getAngleZ()); delay(500); }