I could use some help setting and reading registers (on accel-gyro sensor) #13216
Replies: 4 comments 4 replies
-
@MrTinkerman That looks a whole lot like sign unwrapping problem on the gyro. Look closely at the documentation for the binary representation, and see if you need to do convert an unsigned number to signed. For example, if the number returned is a 16-bit value, try |
Beta Was this translation helpful? Give feedback.
-
Hola esto es todo lo que tengo. El Xiao se me rompió y no pude conseguir otro.
|
Beta Was this translation helpful? Give feedback.
-
@mendenm : @gassechen : |
Beta Was this translation helpful? Give feedback.
-
I ended up adapting: https://github.com/wrh2/LSM6DS3/blob/master/src/lsm6ds3.py for use with uPy. And mendenm, you were right on the 'spikes/jumps'. This does the trick for me now:
Thanks to both of you for your help |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
@gassechen
Hi all,
I'm migrating a project to a Seeed XIAO nRF52840 Sense.
This board has an integrated LSM6DS3TR-C accelerometer/gyro.
The last hurdle is getting the accel/gyro data from the sensor.
There seems to be no library so this is actually the first
time I'm going to have to work with registers.
I found these post: https://github.com/orgs/micropython/discussions/11363
So from that code I have made a start to read out accel and gyro values.
I think I'm on the right track but I'm stuck on configuring the
accel and gyro registers and reading the data.
The accel data is coming in but shows abrupt spikes when turning the board slowly.
And gyro data is all zero.
I hope someone can give me some helpful hints on this, thanks in advance.
Below you will find my code so far, screenshots from the datasheet,
the datasheet and a screenshot of those spikes/transitions.
lsm6ds3tr-c_datasheet.pdf
Beta Was this translation helpful? Give feedback.
All reactions