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

Set Block Data Update bit #42

Merged
merged 1 commit into from
Apr 22, 2024
Merged

Set Block Data Update bit #42

merged 1 commit into from
Apr 22, 2024

Conversation

caternuson
Copy link
Contributor

This fixes an issue that was originally brought up in emails. Adds setting of the Block Data Update bit for the ISM330DHCX and LSM6DS3TRC.

image

This was already in place for other sensor variants, so only added some code comments to those.

Example test for ISM330DHCX:

#include <Adafruit_ISM330DHCX.h>

Adafruit_ISM330DHCX ism330dhcx;

void setup(void) {
  Serial.begin(115200);
  while (!Serial);
  Serial.println("Adafruit ISM330DHCX test!");

  if (!ism330dhcx.begin_I2C()) {
    Serial.println("Failed to find ISM330DHCX chip");
    while (1);
  }
  Serial.println("ISM330DHCX Found!");

  ism330dhcx.setAccelRange(LSM6DS_ACCEL_RANGE_4_G);
  ism330dhcx.setGyroRange(LSM6DS_GYRO_RANGE_1000_DPS);

  ism330dhcx.setAccelDataRate(LSM6DS_RATE_6_66K_HZ);
  ism330dhcx.setGyroDataRate(LSM6DS_RATE_6_66K_HZ);
}

void loop() {
  sensors_event_t accel;
  sensors_event_t gyro;
  sensors_event_t temp;
  ism330dhcx.getEvent(&accel, &gyro, &temp);

  Serial.print(gyro.gyro.x);
  Serial.print(","); Serial.print(gyro.gyro.y);
  Serial.print(","); Serial.print(gyro.gyro.z);
  Serial.println();
}

BEFORE
Screenshot from 2024-04-22 10-15-44

AFTER
Screenshot from 2024-04-22 10-16-24

@caternuson
Copy link
Contributor Author

@ladyada for review

@ladyada ladyada merged commit 0b3e737 into adafruit:master Apr 22, 2024
1 check passed
@ladyada
Copy link
Member

ladyada commented Apr 22, 2024

lovely!

@ladyada
Copy link
Member

ladyada commented Apr 22, 2024

cc @pberthold

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

Successfully merging this pull request may close these issues.

2 participants