09-02-2021 10:57 AM
New insights from today:
- The read data look like this:
The bytes are always repeated in the following order: empty byte - x - x - y - y - z - z
- I filtered out the empty byte (see lower square in the screenshot below)
- So i get the following output:
- Problems:
- sometimes the axes are reversed (see screenshot with the diagram)
- when i place the sensor on a shaker i have jumps again in the measured sinus signal of the shaker. I think the problem is that I always stop and restart streaming in the while loop. I have to do this that I can read out the FIFO level. If the streaming is running and I read the FIFO level I get an error message
I tried to place the start and stop of the streaming outside the while loop and deleted the block with the FIFO level. I set 4096 bytes (FIFO buffer size) as "bytes to read". Without success...
- Michael
09-05-2021 08:39 AM
I don't need the FIFO-level. I can also read a fixed number of bytes from FIFO. If there are fewer values in the FIFO than the number of bytes to be read out, then at the end of the array there is simply garbage (which can be discarded). However, if you look at the peak value of the sine, you can see that the peaks are further apart after a reading process than with the contiguous sine curve. This is most likely due to the fact that the start and stop streaming is in the while loop.
If I put "start stream" and "stop stream" before or after the while loop, then no meaningful data are received .. the first data are correct, but after that there is only wrong data in the array (see picture).
Some ideas for this problem?
I think if I find the problem now, I can get a continuous stream!
- Michael