Save data in a file
- During 10 seconds write to a file the value at A0 at a frequency of one sample per second
- Use a format of time [tab] sample per line
Test with different sampling rates and verify when the samples start to delay.
Create a plot of the last 20 seconds
Use two processes one for the writing and the other to plot. Recreate the plot after a pause of 10 seconds by reading the file again. If needed (for higher sampling rates) do subsampling.