I can then print out the FIFO, with event number in the first column and see the following (again, this is with no motion and basically using the AN4073 section 5.1 example converted to ESP32 code):
0 255 248 0 0 255 192
1 0 0 0 16 255 212
2 255 252 255 248 255 208
3 255 240 255 244 255 244
4 0 16 255 228 0 4
5 255 240 255 240 255 216
6 255 248 255 240 0 0
7 255 252 0 20 0 40
8 0 4 0 4 255 236
9 255 252 255 252 0 12
10 0 24 0 0 255 248
11 0 12 255 240 0 64
12 255 228 255 252 255 252
13 255 248 0 12 255 240
14 0 0 0 40 255 228
15 255 252 255 236 255 208
16 255 236 255 244 0 40
17 0 28 0 20 0 20
18 0 16 0 4 255 216
19 0 8 255 224 0 36
20 255 244 0 20 255 208
21 0 4 14 255 232 0
22 8 0 72 255 252 255
23 228 255 232 255 252 0
24 32 0 8 255 200 255
25 224 0 32 0 12 255
26 212 255 244 255 252 255
27 248 0 16 0 0 255
28 240 0 44 0 12 0
29 16 255 200 255 220 0
30 8 0 44 255 220 255
31 248 0 16 255 228 0
If I then convert this to g values for X ,Y, and Z, I see the following for that same data:
0 -0.00, 0.00, -0.01
1 0.00, 0.00, -0.01
2 -0.00, -0.00, -0.01
3 -0.00, -0.00, -0.00
4 0.00, -0.00, 0.00
5 -0.00, -0.00, -0.00
6 -0.00, -0.00, 0.00
7 -0.00, 0.00, 0.00
8 0.00, 0.00, -0.00
9 -0.00, -0.00, 0.00
10 0.00, 0.00, -0.00
11 0.00, -0.00, 0.01
12 -0.00, -0.00, -0.00
13 -0.00, 0.00, -0.00
14 0.00, 0.00, -0.00
15 -0.00, -0.00, -0.01
16 -0.00, -0.00, 0.00
17 0.00, 0.00, 0.00
18 0.00, 0.00, -0.00
19 0.00, -0.00, 0.00
20 -0.00, 0.00, -0.01
21 0.00, 0.47, -0.75
22 0.25, 2.28, -0.09
23 -0.84, -0.72, -0.12
24 1.00, 0.28, -1.72
25 -1.00, 1.00, 0.41
26 -1.34, -0.34, -0.09
27 -0.25, 0.50, 0.03
28 -0.50, 1.38, 0.38
29 0.53, -1.72, -1.12
30 0.25, 1.41, -1.09
31 -0.25, 0.53, -0.88
Now here, we see zero g on all three axes (whereas we should see ~1g on the z-axis) until we get to the 21st event and then the data goes all over the place.
I can only conclude that the method I am using to read the FIFO is incorrect. Can anyone see the error in my method and share some pointers with me?
Thank you!