Enable interrupt generation - #14
Open
guiescuissato wants to merge 3 commits into
Open
guiescuissato wants to merge 3 commits into
guiescuissato wants to merge 3 commits into
Conversation
|
Can the conflicts be fixed and this PR merged? It contains very useful functionality that is currently missing form the library, notably: trigger the interrupt pin when updated values are available. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello! The motivation for me creating this pull request is being able to generate interrupts on a GY-521 board. I basically created 2 functions, to enable and disable interrupt generation:
void enableInterrupt(mpu6050_int_source_t int_source);void disableInterrupt(mpu6050_int_source_t int_source);The enum 'mpu6050_int_source_t' specifies which type of interrupt generation source should generate an interrupt, according to register 0x38:
Since I only required the Data Ready Interrupt for my project, I didn't get to test the FIFO Buffer Overflow Interrupt or the I2C Master Interrupt. But, as I believe you'll agree, their enabling should work well with these functions.
To show you how I intended to use these functions, I also created an example that worked on an Arduino Pro Micro with the GY-521 board. The name of the example is 'interrupt_readings'. To better organize these changes, I did 2 commits, one for editing the library and another for creating the example. (edit: a 3rd to apply clang-format)
I hope you find these changes relevant and valuable! They certainly will be valuable to me, at least ;)