element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Design For A Cause 2021
  • Challenges & Projects
  • Design Challenges
  • Design For A Cause 2021
  • More
  • Cancel
Design For A Cause 2021
Blog ACE - Blog #8 - Offloading computation to LSM6DS3
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: amgalbu
  • Date Created: 23 May 2021 5:09 PM Date Created
  • Views 3307 views
  • Likes 6 likes
  • Comments 9 comments
  • ace
  • design for a cause - design challenge
  • design for a cause
  • design for a cause design challenge
  • design_for_a_cause_2021
Related
Recommended

ACE - Blog #8 - Offloading computation to LSM6DS3

amgalbu
amgalbu
23 May 2021

As I said in this blog, I experienced a lot issues when I tried to run the neural network on the Arduino Nano 33 IoT and I switched to a classic threshold-based algorithm to detect a fall. In a few words, I will detect three phases of the fall

  • free-fall (rectangle "1" in picture below)
  • impact
  • inactivity (rectangle "2" in picture below)

image

 

Currently, all these operations are performed by the SAM21D MCU, but the LSM6DS3 IMU includes a lot of interesting features that worth to be investigated to off-load some of the computations from the SAMD21D MCU to the LSM6DS3 IMU.

The idea is to extend the LSM6DS3 library by adding proper methods to configure free-fall, impact and inactivity detection parameters

 

The original LSM6DS3 library

The original LSM6DS3 implements three functions that are going to be very useful for my work

 

class LSM6DS3Class {
  public:
[...]

  private:
    int readRegister(uint8_t address);
    int readRegisters(uint8_t address, uint8_t* data, size_t length);
    int writeRegister(uint8_t address, uint8_t value);

[...]


};

 

These three functions will give me full access to any register in the IMU chip, so I can configure detection algorithms according to my needs

 

Initialization

The LMS6DS3 must be initialized. This task is already accomplished by the original library, which writes register CTRL1_XL

image

image

 

This is how the Arduino library initializes the LMS6DS3

 

  //set the gyroscope control register to work at 104 Hz, 2000 dps and in bypass mode
  writeRegister(LSM6DS3_CTRL2_G, 0x4C);


  // Set the Accelerometer control register to work at 104 Hz, 4G,and in bypass mode and enable ODR/4
  // low pass filter(check figure9 of LSM6DS3's datasheet)
  writeRegister(LSM6DS3_CTRL1_XL, 0x4A);


  // set gyroscope power mode to high performance and bandwidth to 16 MHz
  writeRegister(LSM6DS3_CTRL7_G, 0x00);


  // Set the ODR config register to ODR/4
  writeRegister(LSM6DS3_CTRL8_XL, 0x09);

 

The important thing here is the ODR_XL (Accelerometer Output data rate), which is set to 104 Hz (4Ah is written in CTRL1_XL register) and is required when we will have to calculate to values to write into configuration registers

ODR_XL=104 Hz

FS_XL = 4g

 

Free-fall detection

Free-fall detection refers to a specific register configuration that allows recognizing when the device is in free-fall: the acceleration measured along all the axes goes to zero. In a real case a “free-fall zone” is defined around the zero-g level where all the accelerations are small enough to generate the interrupt. Configurable threshold and duration parameters are associated to free-fall event detection: the threshold parameter defines the free-fall zone amplitude; the duration parameter defines the minimum duration of the free-fall interrupt event to be recognized

image

Free-fall threshold duration and threshold are set in register FREE_FALL and WAKE_UP_DUR, whose content is shown in screenshot below (from LSM6DS3 datasheet)

image

 

image

 

The free-fall condition can be checked by reading the FF_IA bit of the WAKE_UP_SRC register. However, there are some caveats here. By default, the free-fall condition is not latched (LIR bit of the TAP_CFG register)

image

This means that the FF_IA bit is set when the free-fall condition is detected and reset when the free-fall condition is no longer there. This may lead to loose events, because we poll the IMU at a fixed rate, and the event may occur between two polls. For sure, we need to enable latch mode. But if the latch mode is enabled but the interrupt signal is not driven to the interrupt pins, the latch feature does not take effect. This means we need to drive the free-fall interrupt signal to a pin, even if the pin on the Arduino Nano 33 IoT is not connected. The free-fall interrupt signal can be driven to the two interrupt pins by setting to 1 the INT1_FF bit of the MD1_CFG register or the INT2_FF bit of the MD2_CFG register. With these settings, latch mode can be enabled and, when a free-fall event has occurred and the interrupt pin is asserted, it must be reset by reading the WAKE_UP_SRC register.

 

 

image

image

 

Pseudo-code

To summarize, here is the pseudo-code required to initialize free-fall detection

  • Set event duration (FF_DUR5 bit) - Write 00h into WAKE_UP_DUR
  • Set FF threshold (FF_THS[2:0] = 011b) and set six samples event duration (FF_DUR[5:0] = 000110b) - Write 33h into FREE_FALL
  • Drive free-fall interrupt to INT1 pin - Write 10h into MD1_CFG
  • Latch interrupt - Write 01h into TAP_CFG

To check if a free-fall event has occurred, read register WAKE_UP_SRC and check if bit 5 (FF_IA) is set

 

Impact detection

The LSM6DS3 device can be configured to output an interrupt signal when tapped (once or twice) in any direction: the TAP_X_EN, TAP_Y_EN and TAP_Z_EN bits of the TAP_CFG register must be set to 1 to enable the tap recognition on X, Y, Z directions, respectively.

Configurable parameters for tap recognition functionality are the tap threshold and the Shock, Quiet and Duration time windows.

The TAP_THS[4:0] bits of the TAP_THS_6D register are used to select the unsigned threshold value used to detect the tap event. The value of 1 LSB of these 5 bits depends on the selected accelerometer full scale: 1 LSB = (FS_XL)/(25). The unsigned threshold is applied to both positive and negative slope data. The Shock time window defines the maximum duration of the overthreshold event: the acceleration must return below the threshold before the Shock window has expired, otherwise the tap event is not detected. The SHOCK[1:0] bits of the INT_DUR2 register are used to set the Shock time window value: the default value of these bits is 00b and corresponds to 4/ODR_XL time, where ODR_XL is the accelerometer output data rate. If the SHOCK[1:0] bits are set to a different value, 1 LSB corresponds to 8/ODR_XL time.

In the double-tap case, the Quiet time window defines the time after the first tap recognition in which there must not be any overthreshold. When the latch mode is disabled (LIR bit of TAP_CFG is set to 0), the Quiet time also defines the length of the interrupt pulse (in both single and double-tap case). The QUIET[1:0] bits of the INT_DUR2 register are used to set the Quiet time window value: the default value of these bits is 00b and corresponds to 2/ODR_XL time, where ODR_XL is the accelerometer output data rate. If the QUIET[1:0] bits are set to a different value, 1 LSB corresponds to 4/ODR_XL time.

image

Tap interrupt signals can also be checked by reading the TAP_SRC (1Ch) register

image

  • TAP_IA is set high when a single-tap or double-tap event has been detected.
  • SINGLE_TAP is set high when a single tap has been detected.
  • DOUBLE_TAP is set high when a double tap has been detected.
  • TAP_SIGN indicates the acceleration sign when the tap event is detected. It is set low in case of positive sign and it is set high in case of negative sign.
  • X_TAP (Y_TAP, Z_TAP) is set high when the tap event has been detected on the X (Y, Z) axis.

 

Single and double-tap recognition works independently. To enable only the single-tap recognition. we need to set the SINGLE_DOUBLE_TAP bit of WAKE_UP_THS to 0.

If the latch mode is enabled and the interrupt signal is driven to the interrupt pins, the value assigned to SINGLE_DOUBLE_TAP also affects the behavior of the interrupt signal: when it is set to 0, the latch mode is applied to the single-tap interrupt signal; when it is set to 1, the latch mode is applied to the double-tap interrupt signal only. The latched interrupt signal is kept high until the TAP_SRC register is read. If the latch mode is enabled but the interrupt signal is not driven to the interrupt pins, the latch feature does not take effect.

 

Pseudo-code

Here is the pseudo-code to configure impact detection

  • Enable tap detection on X, Y, Z axis - Write 0Eh into TAP_CFG
  • Set tap threshold - Write 0Bh into TAP_THS_6D
  • Set Quiet and Shock time windows - Write 00h into INT_DUR2
  • Only single tap enabled (SINGLE_DOUBLE_TAP = 0) - Write 00h into WAKE_UP_THS
  • Single tap interrupt driven to INT1 pin - Write 40h into MD1_CFG
  • Latch interrupt - Write 01h into TAP_CFG

 

The TAP_THS field of the TAP_THS_6D register is set to 01011b, therefore the tap threshold is 1375 mg (= 11 * FS_XL / 2^5).

The SHOCK field of the INT_DUR2 register is set to 10b: an interrupt is generated when the slope data exceeds the programmed threshold, and returns below it within 19.8 ms (= 2  / ODR_XL) corresponding to the Shock time window.

 

Activity/inactivity recognition

The Activity/Inactivity recognition function was actually designed to reduce system power consumption, but in this case we will use this feature to determine if the elder is motionless or not.

When the Activity/Inactivity recognition function is activated, the LSM6DS3 device is able to automatically decrease the accelerometer sampling rate to 12.5 Hz, increasing the accelerometer ODR and bandwidth as soon as the wake-up interrupt event has been detected. This feature is applied to the accelerometer sensor only, regardless of the selected gyroscope power mode and ODR. The maximum allowed accelerometer ODR (configurable through the ODR_XL [3:0] bits of the CTRL1_XL register) for using the Activity/Inactivity feature is 833 Hz.

With this feature the system may be efficiently switched from low-power consumption to full performance and vice-versa depending on user-selectable acceleration events, thus ensuring power saving and flexibility.

The Activity/Inactivity recognition function is enabled by setting to 1 the INACTIVITY bit of the WAKE_UP_THS register.

In the LSM6DS3 device the Activity/Inactivity recognition function can be implemented using either the slope filter or the high-pass digital filter.

image

 

The filter to be applied can be selected using the SLOPE_FDS bit of the TAP_CFG register: if this bit is set to 0 (default value), the slope filter is used; if it’s set to 1, the high-pass digital filter is used.

This function can be fully programmed by the user in terms of expected amplitude and timing of the slope data by means of a dedicated set of registers.

 

image

 

The unsigned threshold value is defined using the WK_THS[5:0] bits of dedicated set of registers WAKE_UP_THS register

image

 

The value of 1 LSB of these 6 bits depends on the selected accelerometer full scale: 1 LSB = (FS_XL)/(2^6). The threshold is applied to both positive and negative filtered data.

When a certain number of consecutive X,Y,Z slope data is smaller than the configured threshold, the ODR_XL [3:0] bits of the CTRL1_XL register are bypassed (Inactivity) and the accelerometer is internally set to 12.5 Hz although the content of CTRL1_XL is left untouched. The duration of the Inactivity status to be recognized is defined by the SLEEP_DUR[3:0] bits of the WAKE_UP_DUR register: 1 LSB corresponds to 512/ODR_XL time, where ODR_XL is the accelerometer output data rate.

Once the Activity/Inactivity detection function is enabled, the status can be driven to the two interrupt pins by setting to 1 the INT1_INACT_STATE bit of the MD1_CFG register or the INT1_INACT_STATE bit of the MD2_CFG register; it can also be checked by reading the SLEEP_STATE_IA bit of the WAKE_UP_SRC register.

 

Pseudo-code

Here is the pseudo-code to initialize the activity detection

  • Set duration for Inactivity detection - Write 01h into WAKE_UP_DUR
  • Set Activity/Inactivity threshold, Enable Activity/Inactivity detection - Write 42h into WAKE_UP_THS
  • Activity/Inactivity interrupt driven to INT1 pin - Write 80h into MD1_CFG

 

In this example the WK_THS field of the WAKE_UP_THS register is set to 000010b, therefore the Activity/Inactivity threshold is 125 mg (= 2 * FS_XL / 2^6).

Before Inactivity detection, the X,Y,Z slope data must be smaller than the configured threshold for a period of time defined by the SLEEP_DUR field of the WAKE_UP_DUR register: this field is set to 0010b, corresponding to 4.92 s (= 1 * 512 / ODR_XL). After this period of time has elapsed, the accelerometer ODR is internally set to 12.5 Hz.

The Activity status is detected and the CTRL1_XL register settings immediately restored if the slope data of (at least) one axis are bigger than the threshold.

 

Previous postSource codeNext post
ACE - Blog #7 - Improving the device constructionhttps://github.com/ambrogio-galbusera/ace2.gitACE - Blog #9 - Conclusions
  • Sign in to reply

Top Comments

  • javagoza
    javagoza over 4 years ago in reply to javagoza +1
    Maybe you can use this approach reading the Wake up interrupt source register Wake up interrupt source register https://os.mbed.com/teams/ST/code/X_NUCLEO_IKS01A1/docs/tip/lsm6ds3__class_8cpp_source.html…
  • javagoza
    javagoza over 4 years ago in reply to amgalbu +1
    The Arduino LSM6DS3 supports both SPI and Wire (I2C) https://github.com/arduino-libraries/Arduino_LSM6DS3/blob/master/src/LSM6DS3.h LSM6DS3Class(TwoWire& wire, uint8_t slaveAddress); LSM6DS3Class(SPIClass&…
  • amgalbu
    amgalbu over 4 years ago in reply to javagoza +1
    Thanks Enrique ! That's exactly what I wrote in the post but it's good to have a confirmation Ambrogio
  • TobiasR
    TobiasR over 2 years ago in reply to TobiasR

    Should notice I tried the SparkFun sample (just changed a bit so it fits the correct I2C address.

    This sample code also doesn't trigger any free-fall events:

    #include "LSM6DS3.h"
    #include "Wire.h"
    #include "SPI.h"

    LSM6DS3 myIMU( I2C_MODE, 0x6A );

    void setup() {
       Serial.begin(9600);
       while (!Serial) {
       ; // wait for serial port to connect. Needed for native USB port only
       }
       Serial.println("Sketch came out of reset.\n");
       if( myIMU.begin() != 0 )
       {
          Serial.print("Error at begin().\n");
       }
       else
       {
          Serial.print("\nbeginCore() passed.\n");
       }

       uint8_t errorAccumulator = 0;
       uint8_t dataToWrite = 0;

       //Setup the accelerometer******************************
       dataToWrite = 0; //Start Fresh!
       dataToWrite |= LSM6DS3_ACC_GYRO_BW_XL_200Hz;
       dataToWrite |= LSM6DS3_ACC_GYRO_FS_XL_2g;
       dataToWrite |= LSM6DS3_ACC_GYRO_ODR_XL_416Hz;

       //Now, write the patched together data
       errorAccumulator += myIMU.writeRegister(LSM6DS3_ACC_GYRO_CTRL1_XL, dataToWrite);
       errorAccumulator += myIMU.readRegister(&dataToWrite, LSM6DS3_ACC_GYRO_CTRL4_C);

       // Write 00h into WAKE_UP_DUR
       errorAccumulator += myIMU.writeRegister( LSM6DS3_ACC_GYRO_WAKE_UP_DUR, 0x00 );

       // Set FF threshold (FF_THS[2:0] = 011b)
       // Set six samples event duration (FF_DUR[5:0] = 000110b)
       // Write 33h into FREE_FALL
       errorAccumulator += myIMU.writeRegister(LSM6DS3_ACC_GYRO_FREE_FALL, 0x33);

       // FF interrupt driven to INT1 pin
       // Write 10h into MD1_CFG
       errorAccumulator += myIMU.writeRegister( LSM6DS3_ACC_GYRO_MD1_CFG, 0x10 );
       // Also route to INT2 pin
       // Write 10h into MD1_CFG
       errorAccumulator += myIMU.writeRegister( LSM6DS3_ACC_GYRO_MD2_CFG, 0x10 );
       // Latch interrupt
       // Write 01h into TAP_CFG
       errorAccumulator += myIMU.writeRegister(LSM6DS3_ACC_GYRO_TAP_CFG1, 0x01);
       if( errorAccumulator )
       {
          Serial.println("Problem configuring the device.");
       }
       else
       {
          Serial.println("Device O.K.");
       }
    }

    void loop()
    {
       uint8_t readDataByte = 0;
       //Read the wake-up source register
       myIMU.readRegister(&readDataByte, LSM6DS3_ACC_GYRO_WAKE_UP_SRC);
       //Mask off the FF_IA bit for free-fall detection
       readDataByte &= 0x20;
       //Check for free-fall
       if( readDataByte )
       {
       //debounce
       delay(10);
       Serial.println("Interrupt caught. Free fall detected.");
    }
    }
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • TobiasR
    TobiasR over 2 years ago

    Thanks for the nice blog post.

    I'm trying to detect free falls with my XIAO nRF52840 which has the LSM6DS3 included.

    However, I can't make it work to receive an interrupt for this. (Double) Taps work fine but the free-fall detection never interrupts anything.

    Even the sample code from the libraries doesn't result anything (it compiles, just does not trigger).

    I even asked in forums like here

    https://forum.arduino.cc/t/lsm6ds3-free-fall-detection-not-working/1163290/7

    and

    https://forum.seeedstudio.com/t/xiao-nrf52840-free-fall-detection-not-working/272103

    but you seem to be the "reference to go":

    My current code looks like that, just in case you see anything I messed up or forgot.

    Thanks for any help!

    ---

    #include "LSM6DS3.h"
    #include "Wire.h"

    LSM6DS3 myIMU(I2C_MODE, 0x6A);
    #define int1Pin PIN_LSM6DS3TR_C_INT1

    volatile uint8_t interruptCount = 0; // Amount of received interrupts
    uint8_t prevInterruptCount = 0; // Interrupt Counter from last loop

    void setup() {
      Serial.begin(9600);
      while (!Serial) {
      ; // wait for serial port to connect. Needed for native USB port only
      }

      Serial.println("--- START ---");
      pinMode(LED_RED, OUTPUT);
      pinMode(LED_GREEN, OUTPUT);
      pinMode(LED_BLUE, OUTPUT);
      setLedRGB(false, false, true); // set blue led

      myIMU.settings.accelEnabled = 1;
      myIMU.settings.tempEnabled = 1;
      myIMU.settings.gyroEnabled = 1; // Gyro currently not used, disabled to save power
      if (myIMU.begin() != 0) {
        Serial.println("IMU error");
      } else {
        Serial.println("IMU OK!");
      }
      setupFreeFallInterrupt();
      pinMode(int1Pin, INPUT);
      attachInterrupt(digitalPinToInterrupt(int1Pin), int1ISR, RISING);
    }

    void loop() {
      setLedRGB(false, false, true); // reset led to blue only

      Serial.print("\Iterrupt Counter: ");
      Serial.println(interruptCount);

     // if interrupt was received in this cycle
      if (interruptCount > prevInterruptCount) {
       Serial.println("\Interrupt received!");
       setLedRGB(false, true, false); // set green only
      }
     prevInterruptCount = interruptCount;
      if (interruptCount >= 5) {
       // Trigger System OFF after 5 interrupts
       goToPowerOff();
      }
      myIMU.writeRegister(LSM6DS3_ACC_GYRO_TAP_CFG1, 0x01); // LATCHED

      delay(500);
    }


    // -------------------- System ------------------------- //

    void goToPowerOff() {
      setLedRGB(false, false, false);
      Serial.println("Going to System OFF");
      setupFreeFallInterrupt(); // not needed here, if already applied..
      delay(100); // delay seems important to apply settings, before going to System OFF
      //Ensure interrupt pin from IMU is set to wake up device
      nrf_gpio_cfg_sense_input(digitalPinToInterrupt(int1Pin), NRF_GPIO_PIN_PULLDOWN, NRF_GPIO_PIN_SENSE_HIGH);
      // Trigger System OFF
      NRF_POWER->SYSTEMOFF = 1;
    }

    // -------------------- Interrupts ------------------------- //

    void setupFreeFallInterrupt() {
     uint8_t error = 0;
     uint8_t dataToWrite = 0;
     
     dataToWrite |= LSM6DS3_ACC_GYRO_BW_XL_100Hz; // 0000 0001 200Hz
     dataToWrite |= LSM6DS3_ACC_GYRO_FS_XL_4g; // 0000 0000 2g
     dataToWrite |= LSM6DS3_ACC_GYRO_ODR_XL_104Hz;// 0100 0000 104Hz

     error += myIMU.writeRegister(LSM6DS3_ACC_GYRO_CTRL1_XL, dataToWrite);
     error += myIMU.writeRegister(LSM6DS3_ACC_GYRO_WAKE_UP_SRC, 0b00100000);
     error += myIMU.writeRegister(LSM6DS3_ACC_GYRO_TAP_CFG1, 0b00000001);
     error += myIMU.writeRegister(LSM6DS3_ACC_GYRO_WAKE_UP_DUR, 0b00000000);
     error += myIMU.writeRegister(LSM6DS3_ACC_GYRO_FREE_FALL, 0b000110);

      if (error) {
        Serial.println("Problem configuring the device.");
      } else {
        Serial.println("Device O.K.");
      }
    }

    void int1ISR()
    {
       interruptCount++;
    }

    // -------------------- Utilities ------------------------- //

    void setLedRGB(bool red, bool green, bool blue) {
      if (!blue) { digitalWrite(LED_BLUE, HIGH); } else { digitalWrite(LED_BLUE, LOW); }
      if (!green) { digitalWrite(LED_GREEN, HIGH); } else { digitalWrite(LED_GREEN, LOW); }
      if (!red) { digitalWrite(LED_RED, HIGH); } else { digitalWrite(LED_RED, LOW); }
    }
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • amgalbu
    amgalbu over 4 years ago in reply to javagoza

    Thanks a lot!

    Ambrogio

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • amgalbu
    amgalbu over 4 years ago in reply to javagoza

    Thanks Enrique !

    That's exactly what I wrote in the post but it's good to have a confirmation

     

    Ambrogio

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • javagoza
    javagoza over 4 years ago in reply to amgalbu

    The Arduino LSM6DS3 supports both SPI and Wire (I2C)

    https://github.com/arduino-libraries/Arduino_LSM6DS3/blob/master/src/LSM6DS3.h

        LSM6DS3Class(TwoWire& wire, uint8_t slaveAddress);

        LSM6DS3Class(SPIClass& spi, int csPin, int irqPin);

     

    But the Arduino Nano 33 IoT uses I2C

    https://www.arduino.cc/en/Guide/NANO33IoT#features

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
>
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube