-
Notifications
You must be signed in to change notification settings - Fork 2
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
LSM9DS1 interrupts #5
base: main
Are you sure you want to change the base?
Conversation
Only some very slight changes, but I (at least within main.cpp and the SPIDevice and LSM9DS1 libraries) removed the dependency on the UART.h library since this isn't support for teensy lc. The main change was modifying all references to pin_size_t to uint16_t and adding SPI.begin() to setup.
@@ -105,6 +110,18 @@ void LSM9DS1::readGyroscope(float &x, float &y, float &z) { | |||
} | |||
|
|||
|
|||
void LSM9DS1::setGyroActivity(bool wake) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review this method and the registers used, please add clarifying comments on the register in the header file
@@ -125,6 +142,154 @@ void LSM9DS1::readMagnetosensor(float &x, float &y, float &z) { | |||
z = z_raw * resolution / 1000; | |||
} | |||
|
|||
void LSM9DS1::configXLInterrupt(INT_XL_CONFIG intConfig, bool andInterrupt, uint8_t duration) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Read the configuration in the registers here and update those values instead of writing directly to the register to avoid overwriting bits that were already set
@@ -1,21 +1,24 @@ | |||
#include <Arduino.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please migrate main code here to its own test file that we can invoke individually
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Investigate what testing suite or general testing support is offered by PlatformIO
Added interrupt functionality to the LSM9DS1 library.