Adafruit_BNO055 icon indicating copy to clipboard operation
Adafruit_BNO055 copied to clipboard

Interrupt Functions

Open mrkaroshi opened this issue 8 years ago • 4 comments

Interrupt Codes: ACC_NM - Accelerometer No Motion ACC_SM - Accelerometer Slow Motion ACC_AM - Accelerometer Any Motion ACC_HIGH_G - Accelerometer High G GYR_HIGH_RATE - Gyroscope High Rate GYRO_AM - Gyroscope Any Motion

enableInterrupts() takes the type of interrupt code, such as ACC_NM (Accelerometer No Motion), and whether the developer wants the INT pin to trigger as two arguments.

enableInterruptAxes() takes the interrupt code, and the axes to allow to trigger it, as two arguments and enables them. Currently there is no 'disable' function but this is due.

setIntThreshold() takes the interrupt code and a threshold value, as well as a string to define the axis and sets the input to exceed in order to trigger an interrupt. Each type of threshold is different for each code, so there is a serial output comment to reflect when the developer has set an invalid value. This can be made unnecessary by adding the function usage case to the Wiki.

setIntDuration() take the interrupt code and a duration value, as as a string to define the axes (not implemented currently), and sets the duration for which the threshold must be exceeded in order to trigger.

checkInterruptStates() is a sanity check for all interrupt registers, allowing the developer to drop this into their code and check setup and runtime behaviours.

readIntStatus() is best used as the callback function for the interrupt service routine, reading the status code from the INT_STA register.

clearInt() clears and resets the interrupt so the pin will return to it's previous level.

printWithZeros() ensures the register values are printed with their leading zeros.

mrkaroshi avatar Mar 21 '17 16:03 mrkaroshi

I would be interested in merging support for this in, but is there any chance the PR could be reformated as a single commit so that the code can be reviewed in one place before the merge? (Sorry for the very slow reply here as well).

microbuilder avatar Jan 11 '18 13:01 microbuilder

Sorry I’m not really sure what you mean, PR? If the commits need tidying up a bit how would I achieve what you need to review them easier?

On 11 Jan 2018, at 14:18, Kevin Townsend [email protected] wrote:

I would be interested in merging support for this in, but is there any chance the PR could be reformated as a single commit so that the code can be reviewed in one place before the merge? (Sorry for the very slow reply here as well).

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/adafruit/Adafruit_BNO055/pull/39#issuecomment-356931288, or mute the thread https://github.com/notifications/unsubscribe-auth/AGBwhdDfMewASVWfyNrMmgJ0fpk-pW7Kks5tJgojgaJpZM4MkCRS.

mrkaroshi avatar Jan 11 '18 15:01 mrkaroshi

I think he wants you to squash your commits.

https://forum.freecodecamp.org/t/how-to-squash-multiple-commits-into-one-with-git/13231

David

On Thu, Jan 11, 2018 at 8:48 AM, kA®0šhî [email protected] wrote:

Sorry I’m not really sure what you mean, PR? If the commits need tidying up a bit how would I achieve what you need to review them easier?

On 11 Jan 2018, at 14:18, Kevin Townsend [email protected] wrote:

I would be interested in merging support for this in, but is there any chance the PR could be reformated as a single commit so that the code can be reviewed in one place before the merge? (Sorry for the very slow reply here as well).

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub < https://github.com/adafruit/Adafruit_BNO055/pull/39#issuecomment-356931288>, or mute the thread <https://github.com/notificati ons/unsubscribe-auth/AGBwhdDfMewASVWfyNrMmgJ0fpk-pW7Kks5tJgojgaJpZM4MkCRS .

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/adafruit/Adafruit_BNO055/pull/39#issuecomment-356968139, or mute the thread https://github.com/notifications/unsubscribe-auth/AAGyxCiLA-5tyKSk-MI2f8eBupZgXkVGks5tJi1DgaJpZM4MkCRS .

dhiltonp avatar Jan 11 '18 16:01 dhiltonp

It's OK, I can see all the changes in one place here so I'll review that: https://github.com/adafruit/Adafruit_BNO055/pull/39/files

microbuilder avatar Jan 11 '18 16:01 microbuilder