Skip to content

Commit

Permalink
Merge pull request #14 from adafruit/dhct_dhcx
Browse files Browse the repository at this point in the history
correcting "DHCT" typo
  • Loading branch information
siddacious authored Jun 26, 2020
2 parents b1bee41 + bfcaf6d commit 1eabcbd
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 43 deletions.
12 changes: 6 additions & 6 deletions Adafruit_ISM330DHCT.cpp → Adafruit_ISM330DHCX.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

/*!
* @file Adafruit_ISM330DHCT.cpp Adafruit ISM330DHCT 6-DoF Accelerometer
* @file Adafruit_ISM330DHCX.cpp Adafruit ISM330DHCX 6-DoF Accelerometer
* and Gyroscope library
*
* Bryan Siepert for Adafruit Industries
Expand All @@ -10,16 +10,16 @@
#include "Arduino.h"
#include <Wire.h>

#include "Adafruit_ISM330DHCT.h"
#include "Adafruit_ISM330DHCX.h"

/*!
* @brief Instantiates a new ISM330DHCT class
* @brief Instantiates a new ISM330DHCX class
*/
Adafruit_ISM330DHCT::Adafruit_ISM330DHCT(void) {}
Adafruit_ISM330DHCX::Adafruit_ISM330DHCX(void) {}

bool Adafruit_ISM330DHCT::_init(int32_t sensor_id) {
bool Adafruit_ISM330DHCX::_init(int32_t sensor_id) {
// make sure we're talking to the right chip
if (chipID() != ISM330DHCT_CHIP_ID) {
if (chipID() != ISM330DHCX_CHIP_ID) {
return false;
}
_sensorid_accel = sensor_id;
Expand Down
20 changes: 10 additions & 10 deletions Adafruit_ISM330DHCT.h → Adafruit_ISM330DHCX.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/*!
* @file Adafruit_ISM330DHCT.h
* @file Adafruit_ISM330DHCX.h
*
* I2C Driver for the Adafruit ISM330DHCT 6-DoF Accelerometer and Gyroscope
* I2C Driver for the Adafruit ISM330DHCX 6-DoF Accelerometer and Gyroscope
*library
*
* This is a library for the Adafruit ISM330DHCT breakout:
* This is a library for the Adafruit ISM330DHCX breakout:
* https://www.adafruit.com/products/4480
*
* Adafruit invests time and resources providing this open source code,
Expand All @@ -15,21 +15,21 @@
* BSD license (see license.txt)
*/

#ifndef _ADAFRUIT_ISM330DHCT_H
#define _ADAFRUIT_ISM330DHCT_H
#ifndef _ADAFRUIT_ISM330DHCX_H
#define _ADAFRUIT_ISM330DHCX_H

#include "Adafruit_LSM6DSOX.h"

#define ISM330DHCT_CHIP_ID 0x6B ///< ISM330DHCT default device id from WHOAMI
#define ISM330DHCX_CHIP_ID 0x6B ///< ISM330DHCX default device id from WHOAMI

/*!
* @brief Class that stores state and functions for interacting with
* the ISM330DHCT I2C Digital Potentiometer
* the ISM330DHCX I2C Digital Potentiometer
*/
class Adafruit_ISM330DHCT : public Adafruit_LSM6DSOX {
class Adafruit_ISM330DHCX : public Adafruit_LSM6DSOX {
public:
Adafruit_ISM330DHCT();
~Adafruit_ISM330DHCT(){};
Adafruit_ISM330DHCX();
~Adafruit_ISM330DHCX(){};

private:
bool _init(int32_t sensor_id);
Expand Down
2 changes: 1 addition & 1 deletion Adafruit_LSM6DS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ void Adafruit_LSM6DS::_read(void) {

lsm6ds_gyro_range_t gyro_range = getGyroRange();
float gyro_scale = 1; // range is in milli-dps per bit!
if (gyro_range == ISM330DHCT_GYRO_RANGE_4000_DPS)
if (gyro_range == ISM330DHCX_GYRO_RANGE_4000_DPS)
gyro_scale = 140.0;
if (gyro_range == LSM6DS_GYRO_RANGE_2000_DPS)
gyro_scale = 70.0;
Expand Down
2 changes: 1 addition & 1 deletion Adafruit_LSM6DS.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ typedef enum gyro_range {
LSM6DS_GYRO_RANGE_500_DPS = 0b0100,
LSM6DS_GYRO_RANGE_1000_DPS = 0b1000,
LSM6DS_GYRO_RANGE_2000_DPS = 0b1100,
ISM330DHCT_GYRO_RANGE_4000_DPS = 0b0001
ISM330DHCX_GYRO_RANGE_4000_DPS = 0b0001
} lsm6ds_gyro_range_t;

/** The high pass filter bandwidth */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Basic demo for accelerometer/gyro readings from Adafruit ISM330DHCT
// Basic demo for accelerometer/gyro readings from Adafruit ISM330DHCX

#include <Adafruit_ISM330DHCT.h>
#include <Adafruit_ISM330DHCX.h>

// For SPI mode, we need a CS pin
#define LSM_CS 10
Expand All @@ -9,28 +9,28 @@
#define LSM_MISO 12
#define LSM_MOSI 11

Adafruit_ISM330DHCT ism330dhct;
Adafruit_ISM330DHCX ism330dhcx;
void setup(void) {
Serial.begin(115200);
while (!Serial)
delay(10); // will pause Zero, Leonardo, etc until serial console opens

Serial.println("Adafruit ISM330DHCT test!");
Serial.println("Adafruit ISM330DHCX test!");

if (!ism330dhct.begin_I2C()) {
// if (!ism330dhct.begin_SPI(LSM_CS)) {
// if (!ism330dhct.begin_SPI(LSM_CS, LSM_SCK, LSM_MISO, LSM_MOSI)) {
Serial.println("Failed to find ISM330DHCT chip");
if (!ism330dhcx.begin_I2C()) {
// if (!ism330dhcx.begin_SPI(LSM_CS)) {
// if (!ism330dhcx.begin_SPI(LSM_CS, LSM_SCK, LSM_MISO, LSM_MOSI)) {
Serial.println("Failed to find ISM330DHCX chip");
while (1) {
delay(10);
}
}

Serial.println("ISM330DHCT Found!");
Serial.println("ISM330DHCX Found!");

// ism330dhct.setAccelRange(LSM6DS_ACCEL_RANGE_2_G);
// ism330dhcx.setAccelRange(LSM6DS_ACCEL_RANGE_2_G);
Serial.print("Accelerometer range set to: ");
switch (ism330dhct.getAccelRange()) {
switch (ism330dhcx.getAccelRange()) {
case LSM6DS_ACCEL_RANGE_2_G:
Serial.println("+-2G");
break;
Expand All @@ -45,9 +45,9 @@ void setup(void) {
break;
}

// ism330dhct.setGyroRange(LSM6DS_GYRO_RANGE_250_DPS);
// ism330dhcx.setGyroRange(LSM6DS_GYRO_RANGE_250_DPS);
Serial.print("Gyro range set to: ");
switch (ism330dhct.getGyroRange()) {
switch (ism330dhcx.getGyroRange()) {
case LSM6DS_GYRO_RANGE_125_DPS:
Serial.println("125 degrees/s");
break;
Expand All @@ -63,14 +63,14 @@ void setup(void) {
case LSM6DS_GYRO_RANGE_2000_DPS:
Serial.println("2000 degrees/s");
break;
case ISM330DHCT_GYRO_RANGE_4000_DPS:
case ISM330DHCX_GYRO_RANGE_4000_DPS:
Serial.println("4000 degrees/s");
break;
}

// ism330dhct.setAccelDataRate(LSM6DS_RATE_12_5_HZ);
// ism330dhcx.setAccelDataRate(LSM6DS_RATE_12_5_HZ);
Serial.print("Accelerometer data rate set to: ");
switch (ism330dhct.getAccelDataRate()) {
switch (ism330dhcx.getAccelDataRate()) {
case LSM6DS_RATE_SHUTDOWN:
Serial.println("0 Hz");
break;
Expand Down Expand Up @@ -106,9 +106,9 @@ void setup(void) {
break;
}

// ism330dhct.setGyroDataRate(LSM6DS_RATE_12_5_HZ);
// ism330dhcx.setGyroDataRate(LSM6DS_RATE_12_5_HZ);
Serial.print("Gyro data rate set to: ");
switch (ism330dhct.getGyroDataRate()) {
switch (ism330dhcx.getGyroDataRate()) {
case LSM6DS_RATE_SHUTDOWN:
Serial.println("0 Hz");
break;
Expand Down Expand Up @@ -144,16 +144,16 @@ void setup(void) {
break;
}

ism330dhct.configInt1(false, false, true); // accelerometer DRDY on INT1
ism330dhct.configInt2(false, true, false); // gyro DRDY on INT2
ism330dhcx.configInt1(false, false, true); // accelerometer DRDY on INT1
ism330dhcx.configInt2(false, true, false); // gyro DRDY on INT2
}

void loop() {
// /* Get a new normalized sensor event */
sensors_event_t accel;
sensors_event_t gyro;
sensors_event_t temp;
ism330dhct.getEvent(&accel, &gyro, &temp);
ism330dhcx.getEvent(&accel, &gyro, &temp);

Serial.print("\t\tTemperature ");
Serial.print(temp.temperature);
Expand Down Expand Up @@ -195,4 +195,4 @@ void loop() {
// Serial.print(","); Serial.print(gyro.gyro.z);
// Serial.println();
// delayMicroseconds(10000);
}
}
2 changes: 1 addition & 1 deletion examples/adafruit_lsm6ds33_test/adafruit_lsm6ds33_test.ino
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ void setup(void) {
case LSM6DS_GYRO_RANGE_2000_DPS:
Serial.println("2000 degrees/s");
break;
case ISM330DHCT_GYRO_RANGE_4000_DPS:
case ISM330DHCX_GYRO_RANGE_4000_DPS:
break; // unsupported range for the DS33
}

Expand Down
2 changes: 1 addition & 1 deletion examples/adafruit_lsm6dsox_test/adafruit_lsm6dsox_test.ino
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ void setup(void) {
case LSM6DS_GYRO_RANGE_2000_DPS:
Serial.println("2000 degrees/s");
break;
case ISM330DHCT_GYRO_RANGE_4000_DPS:
case ISM330DHCX_GYRO_RANGE_4000_DPS:
break; // unsupported range for the DSOX
}

Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=Adafruit LSM6DS
version=3.2.2
version=4.0.0
author=Adafruit <[email protected]>
maintainer=Adafruit <[email protected]>
sentence=Arduino library for the LSM6DS sensors in the Adafruit shop
Expand Down

0 comments on commit 1eabcbd

Please sign in to comment.