defragster
Senior Member+
That whole structure is 224 bytes. It would take ~90KB to save 20 of those each second for 20 seconds - which would work for a first pass if desired.
To reduce that make a second (copy of that) Struct with only the 20 desired values. Then make an array of 400 ( or more ) of those structs and then index through them 20/sec for 20 seconds and transfer the then current values to the array for storage.
Then figure out how to start the sampling and to stop it. When stopped loop through those elements with sample data and do Serial.printf() of the values in the desired CSV format for review.
Once that is working store then on the SD card as well in groups of 512 bytes.
With that working you can perhaps evolve the logging to work out the SD writing during the sampling in some fashion.
To reduce that make a second (copy of that) Struct with only the 20 desired values. Then make an array of 400 ( or more ) of those structs and then index through them 20/sec for 20 seconds and transfer the then current values to the array for storage.
Then figure out how to start the sampling and to stop it. When stopped loop through those elements with sample data and do Serial.printf() of the values in the desired CSV format for review.
Once that is working store then on the SD card as well in groups of 512 bytes.
With that working you can perhaps evolve the logging to work out the SD writing during the sampling in some fashion.