Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

icm20948 not working correctly on raspberry pi 4 #134

Open
benjamin0789 opened this issue Dec 24, 2023 · 0 comments
Open

icm20948 not working correctly on raspberry pi 4 #134

benjamin0789 opened this issue Dec 24, 2023 · 0 comments

Comments

@benjamin0789
Copy link

benjamin0789 commented Dec 24, 2023

Accelerometer and gyro-values are always 0. I´m using the waveshare environment hat.

`async init() {

    const i2cAccess = await requestI2CAccess();
    const port = i2cAccess.ports.get(1);

    this.mod = new ICM20948(port, 0x68)

    await this.mod.init();
  }

  async read() {

    console.log('update');
    await this.mod.getdata();

    await firstValueFrom(timer(1000).pipe(first()))
    
    console.log("ACCEL: ", this.mod.Accel);
    console.log("GYRO: ", this.mod.Gyro);
    console.log("MAG:", this.mod.Mag);
  }`

log:

ACCEL: [ 0, 0, 0 ]
GYRO: [ 0, 0, 0 ]
MAG: [ 24832.5, -19693, 30011.125 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant