arduino-libraries / Arduino_LSM6DSOX

GNU Lesser General Public License v2.1
20 stars 17 forks source link

Sample rate and full scale of the accelerometer and gyroscope #3

Closed torenrl closed 2 years ago

torenrl commented 3 years ago

Added sample rate and full scale configurations control over the acceleration and gyroscope measurements.

CLAassistant commented 3 years ago

CLA assistant check
All committers have signed the CLA.

github-actions[bot] commented 3 years ago

Memory usage change @ 51fc678697a96764e66917067dfd50b5fd7f5a43

Board flash % RAM for global variables %
arduino:mbed_nano:nanorp2040connect :small_red_triangle: +1504 - +1504 +0.01 - +0.01 :small_red_triangle: +260 - +260 +0.1 - +0.1
Click for full report table Board|examples/SimpleAccelerometer
flash|%|examples/SimpleAccelerometer
RAM for global variables|%|examples/SimpleGyroscope
flash|%|examples/SimpleGyroscope
RAM for global variables|% -|-|-|-|-|-|-|-|- arduino:mbed_nano:nanorp2040connect|1504|0.01|260|0.1|1504|0.01|260|0.1
Click for full report CSV ``` Board,examples/SimpleAccelerometer
flash,%,examples/SimpleAccelerometer
RAM for global variables,%,examples/SimpleGyroscope
flash,%,examples/SimpleGyroscope
RAM for global variables,% arduino:mbed_nano:nanorp2040connect,1504,0.01,260,0.1,1504,0.01,260,0.1 ```
github-actions[bot] commented 3 years ago

Memory usage change @ e5061058c7db39d6b027fa4473d41698c8cf9256

Board flash % RAM for global variables %
arduino:mbed_nano:nanorp2040connect :small_red_triangle: +1504 - +1504 +0.01 - +0.01 :small_red_triangle: +260 - +260 +0.1 - +0.1
Click for full report table Board|examples/SimpleAccelerometer
flash|%|examples/SimpleAccelerometer
RAM for global variables|%|examples/SimpleGyroscope
flash|%|examples/SimpleGyroscope
RAM for global variables|% -|-|-|-|-|-|-|-|- arduino:mbed_nano:nanorp2040connect|1504|0.01|260|0.1|1504|0.01|260|0.1
Click for full report CSV ``` Board,examples/SimpleAccelerometer
flash,%,examples/SimpleAccelerometer
RAM for global variables,%,examples/SimpleGyroscope
flash,%,examples/SimpleGyroscope
RAM for global variables,% arduino:mbed_nano:nanorp2040connect,1504,0.01,260,0.1,1504,0.01,260,0.1 ```
AIWintermuteAI commented 2 years ago

@per1234 any possibility for this PR to go through? the library is incomplete without full control

aentinger commented 2 years ago

Not really, because its not written in a way that such libs should be written. You do keep a local copy of the devices registers but you read from the device, modify the bit(s) that needs modifying and then you write back. Otherwise you'll get inconsistencies really fast (since also the device usually writes to internal registers). Unless you'll amend this PR in the described way I really can't merge this.

americodias commented 2 years ago

Hi guys,

I need this functionality. If I read and write directly from the device register this would be accepted?

Kind regards, Américo

torenrl commented 2 years ago

I guess that's what's done in my fork. You could use that, or implement it yourself if you wish. Anyway, the code I have written is ok if you have control over what happens in the sensor like I had while using it, for more complex use cases, some more verification in the code as suggested earlier in comments is good to have.

americodias commented 2 years ago

Ok. I will try your code then. :)