Add functions for greater control over axis remap #131
+84
−1
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.
Based on Section 3.4 Axis Remap of the BNO055 Datasheet, 2 functions providing greater control of Axis remapping are provided.
configureAxisRemap
allows the user to remap the X, Y and Z axis to another axisconfigureAxisSign
allows the user to remap the signs of the X, Y and Z axis.Although the original library provides the functions
setAxisRemap
andsetAxisSign
, these functions are restrictive as they only allow the user to reconfigure the axis based on the example placements provided which would does not suit every use case.The 2 functions above return bool values that indicate if the configuration was successful. This is done by reading the configuration registers and checking if the value read from the registers match the new values initially rewritten.
Also based on testing and this forum post, I realized that
setExtCrystalUse
can only be called after axis remapping. I feel this should be documented somewhere, as callingsetExtCrystalUse
before axis remapping would lead to axis remapping not working, with the default axis configurations applied instead of the new configuration.