Assistance Needed with ICM42670P Code on Seeed nRF52840

I am currently working on a project involving the ICM42670P sensor,

and I have successfully implemented the code on an Arduino Mega 2560. However,

when I attempt to run the same code on the Seeed nRF52840 board,

I encounter issues and it does not function as expected. even when i scaneed to find address with it, I2C device not found.

Your topic has been moved. Please do not post in "Uncaqtegorized"; see the sticky topics in https://forum.arduino.cc/c/using-arduino/uncategorized/184.

The physical pins are different in Arduino Mega2560 and Seeed nRF52840. Show a wiring diagram and the program code you are using. Describe what you expect to occur and what you observe.

For reference:

The ICM-42670-P is a high performance 6-axis MEMS MotionTracking device that combines a 3-axis gyroscope and a 3-axis accelerometer

this is the code which i used and i double check the pin that should be worked, the main problem is int ret = IMU.begin(); not working

#include <Wire.h>
#include "ICM42670P.h"

ICM42670 IMU(Wire, 0); // Adresse 0x68
void setup() {
Serial.begin(115200);
delay(2000);
while(!Serial);
Serial.println("Initializing ICM42670-P...");
int ret = IMU.begin();
if (ret != 0) {
Serial.print("ICM42670 initialization failed: ");
Serial.println(ret);
while(1);
}
IMU.startAccel(100, 16); // 100 Hz, ±16g
IMU.startGyro(100, 2000); // 100 Hz, ±2000 dps
delay(100);
}
void loop() {
inv_imu_sensor_event_t imu_event;
int ret = IMU.getDataFromRegisters(imu_event);
if (ret == 0) {
// Beschleunigung umrechnen (g)
float accelX = imu_event.accel[0] / 2048.0;
float accelY = imu_event.accel[1] / 2048.0;
float accelZ = imu_event.accel[2] / 2048.0;
// Gyroskop umrechnen (dps)
float gyroX = imu_event.gyro[0] / 16.4;
float gyroY = imu_event.gyro[1] / 16.4;
float gyroZ = imu_event.gyro[2] / 16.4;
// Werte im Format für den seriellen Plotter ausgeben
Serial.print(accelX); Serial.print(",");
Serial.print(accelY); Serial.print(",");
Serial.print(accelZ); Serial.print(",");
Serial.print(gyroX); Serial.print(",");
Serial.print(gyroY); Serial.print(",");
Serial.println(gyroZ); // Neue Zeile nach jedem Satz von Daten
} else {
Serial.print("Failed to read sensor data: ");
Serial.println(ret);
}
delay(10); // 100 Hz Loop-Rate
}

sterretje edit: code tags fixed

I've fixed your code tags.

It's not <CODE> and <CODE/>. It's either [code] and [/code] or three backticks (```) on their own line before or after the code.