Description
Please consider adding APIs for Arduino users to get properly scaled data, with the conversion factor done inside the CurieIMU library. There are at least two reasons why I hope you'll do this:
-
The library can "know" which range is in use, to automatically perform the scaling correctly. In the examples, like File > Examples > CurieIMU > Accelerometer, if a novice Arduino user edits line 36 to configure a wider range, they must also know/remember to edit line 69 to agree with their range setting. While this isn't very difficult for experienced programmers, reducing the possibility for things to go wrong, to make everything "just work" as simply as possible is the design style that makes Arduino so successful.
-
Over the long-term, this API is likely to be used with other sensors which are likely to have different scaling. By abstracting these hardware specific details and avoiding them within the user's code, the API can be much more useful over the very long term.
Probably the simplest approach would be functions with the same names which take references to float, and populate the floats with data properly scaled.