[SOLVED] Question about reading and writing to the same sd card simultaneously
Posted: Thu Jan 19, 2023 1:55 pm
Hi all,
I have a code that takes measurements from a microphone 8 times in a second, those 8 measurements get averaged and a final value for a second is calculated. Then the calculations get appended as a line to a text file in the sd card. In its current state the code runs for some defined duration then sends the final form of the text file to a server.
The thing I want to achieve is that the measurement never stops (until like a physical interrupt). But after some defined duration (say like 15 minutes) the device sends the data from the last 15 minutes to the server. BUT as this sending process is taking place the measurements must still continue and write their results into a file in the sd card.
How should I approach this problem? Utilizing both cores of the esp32? Interrupts?
I have a code that takes measurements from a microphone 8 times in a second, those 8 measurements get averaged and a final value for a second is calculated. Then the calculations get appended as a line to a text file in the sd card. In its current state the code runs for some defined duration then sends the final form of the text file to a server.
The thing I want to achieve is that the measurement never stops (until like a physical interrupt). But after some defined duration (say like 15 minutes) the device sends the data from the last 15 minutes to the server. BUT as this sending process is taking place the measurements must still continue and write their results into a file in the sd card.
How should I approach this problem? Utilizing both cores of the esp32? Interrupts?