Adafruit LSM6DSOX + LIS3MDL FeatherWing - which bits of the example code can I chop out

Please tell us which board you are using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
ddwwcc
 
Posts: 41
Joined: Sun Jan 06, 2019 9:27 am

Adafruit LSM6DSOX + LIS3MDL FeatherWing - which bits of the example code can I chop out

Post by ddwwcc »

Hi,

I have a Adafruit LSM6DSOX + LIS3MDL FeatherWing attached to a ESP32V2, via I2C. I'm adapting the example code for the magnetometer (Adafruit_LIS3MDL library), and trying to work out what I need, and what I don't - mainly the interrupts.

I'm going to use the lis3mdl.read(); method for getting my data, are the interrupts required for this? I've commented out the interrupt setup in the example code, and I can't see any difference when I run the example code.
What are the advantages/disadvantages of setting up the interrupts? What uses them?

Thanks

User avatar
mikeysklar
 
Posts: 11730
Joined: Mon Aug 01, 2016 8:10 pm

Re: Adafruit LSM6DSOX + LIS3MDL FeatherWing - which bits of the example code can I chop out

Post by mikeysklar »

Is this the example code you are running?

https://github.com/adafruit/Adafruit_LI ... l_demo.ino

You can disable interrupts with configInterrupt the last argument. More details here:
arameters
enableX Enable interrupt generation on X-axis
enableY Enable interrupt generation on Y-axis
enableZ Enable interrupt generation on Z-axis
polarity Sets the polarity of the INT output logic
latch If true (latched) the INT pin remains in the same state until INT_SRC is read.
enableInt Interrupt enable on INT pin
https://adafruit.github.io/Adafruit_LIS ... b41e98095f

from the guide pinout page:
INT -This is the interrupt pin. You can setup the LIS3MDL to pull this low when certain conditions are met such as a value exceeding a threshold. Consult the datasheet for usage

User avatar
ddwwcc
 
Posts: 41
Joined: Sun Jan 06, 2019 9:27 am

Re: Adafruit LSM6DSOX + LIS3MDL FeatherWing - which bits of the example code can I chop out

Post by ddwwcc »

Ah, right.

Yes, that's the code I'm running.

Thanks for that. I didn't find the guide that you mention (guide pinout page). Where about's is it? Was going on the resources pointed to form the product page:

https://www.adafruit.com/product/4565

So, either I didn't spot it (probable) or it's not pointed to from that product.

Thanks

User avatar
mikeysklar
 
Posts: 11730
Joined: Mon Aug 01, 2016 8:10 pm

Re: Adafruit LSM6DSOX + LIS3MDL FeatherWing - which bits of the example code can I chop out

Post by mikeysklar »

The interrupt pin quote was from the LIS3MDL guide page:

https://learn.adafruit.com/lis3mdl-trip ... er/pinouts

This pinout page linked from the guide would be more specific to your board:
Other Pins
INT1 -This is the primary interrupt pin for the Accel/Gyro. You can setup the LSM6DSOX or ISM330DHCX to pull this low when certain conditions are met such as new measurement data being available. Consult the datasheet for usage.
INT2 -This is the secondary interrupt pin for the Accel/Gyro. You can setup the LSM6DSOX or ISM330DHCX to pull this low when certain conditions are met such as new measurement data being available. Consult the datasheet for usage.
INTM - This is the primary interrupt pin for the Magnetometer. You can setup the LIS3MDL to pull this low when certain conditions are met such as a value exceeding a threshold. Consult the datasheet for usage.
https://learn.adafruit.com/st-9-dof-com ... dl-pinouts

User avatar
ddwwcc
 
Posts: 41
Joined: Sun Jan 06, 2019 9:27 am

Re: Adafruit LSM6DSOX + LIS3MDL FeatherWing - which bits of the example code can I chop out

Post by ddwwcc »

Yup. That's the one I was looking for, and I see it is linked from the product page. Dang, why did I miss that.

Thanks

Locked
Please be positive and constructive with your questions and comments.

Return to “Feather - Adafruit's lightweight platform”