Skip to content

Another minor correction: sampling frequency bottleneck #2

@renr3

Description

@renr3

Hello guys.
While playing with the sensor and this library, I noticed that changing the ODR settings did not have any impact in the overall behaviour of the sensor: I was able to only get a maximum sampling frequency around 50 Hz (or around it, can't remember the correct value).
Going back to the .cpp file, I tracked down the methods used to get the acceleration values from the sensors. Ultimately, we arrive at the method getRegs, which I assume assess the sensor registers containing the acceleration values. There, I noticed a couple of delays (10 milliseconds and 1 milliseconds), which would be repeated each reading. I considered this as the bottleneck for the sampling frequency I was experiencing.
From another sensor library, I recall reading a discussion about reducing delays needed for registers reading. I proceeded to change all delay() fucntions to delayMicrosseconds(). I adjusted all of them to 1 microseconds and observed consistent behaviour in the measured accelerations.
Therefore, I proposed to each one assess the best values if experiencing insufficient sampling frequency values.
I don't know all the implications of changing such values, so if anyone knows a counterpoint to that, please share with us!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions