Storing 2 port incoming data at a atime in SD casd

hi, I have worked on two individula prototype projects

My Intension is intigrating these 2 individuals as a one prototype
HARD WARE IS READY but GOT STUCK AT CODING

  1. Voice samples recording using microphone

HARDWARE : Arduino Mega2560, Condenser microphone circuite connected to analog port A5 with two button interups connected to D6 (start Rec) D5 (stop Rec) & microSD card (50-MISO,51-MOSI,52-CLK,53-CS)

CODE: Attachment-1

  1. Step counting using pedometer with time stamps

HARDWARE: DSPXO1 3D accelerometer sensor connected to alaog port A4 and RTC DS3231 & microSDcard module (50-MISO,51-MOSI,52-CLK,53-CS)

CODE: attachment-2

IS IT Possible ?
Two incoming analog data loding at a time using multiplexing in one micro SD card ?

APC_Digital_recordnv6.1.ino (8.04 KB)

wrking_BTL.ino (1.21 KB)

IS IT Possible ? Two incoming analog data loding at a time using multiplexing in one micro SD card ?

In the same file? Or in different files? The answer is yes, in either case, though the amount of memory needed is not.

In the same file? Or in different files? The answer is yes, in either case, though the amount of memory needed is not.

I have different file formates microphone is .wav formate and pedo has .csv formate I want them seperate files and wanted to create in one microSD card shield

I will explain

the device is going to wear on a wrist

SO WHEN I NEED TO RECORD THE VOICE SAMPLES I HAVE TO STAND BY AND DO IT RECORDING
OBVIOUSLY NO STEPS TAKING THAT TIME

1st prototype microphone : when i press the start button code will create a dump .wave file in sd card to load the incoming A5 port data then stop button updates the file size and closes it

I want them seperate files and wanted to create in one microSD card shield

So, what is the problem?

I have tried in this way but it didnt work

if(((digitalRead(btnStart)==HIGH && recPressed == 0)) || ((digitalRead(btnStop) == LOW && recPressed == 1))){ // Wen the recoding button id not pressed strat counting steps

voice files doesnt have recorded voices n pedometer no data ( first checking at serial port then log the data to files later)

Final_PrgrmV1.ino (11.1 KB)

#define FIVEMIN (1000UL * 60 * 1) // Every 1 min start logging data

I suggest you make that:

#define IDONTKNOWHATIMDOING (1000UL * 60 * 1) // Every 1 min start logging data
const unsigned int darBufSize = 512;
byte buf00[darBufSize]; // buffer array 1
byte buf01[darBufSize]; // buffer array 2
byte buf02[darBufSize]; // buffer array 3
byte buf03[darBufSize]; // buffer array 4
byte buf04[darBufSize]; // buffer array 4
byte buf05[darBufSize]; // buffer array 4
byte buf06[darBufSize]; // buffer array 4
byte buf07[darBufSize]; // buffer array 4

Stupid comments aside, that's using a lot of memory.

I tried to read the rest of your code, but it wanders all over the place, like a drunken sailor.

I got a headache, so I quit. There is NO excuse for that, given how little time it takes to use Tools + Auto Format.

You open logfile, but never actually write anything to it (except the header) and you never close it.

i KNEW WHAT I AM DOING

512 buffersa are used for not lossing samplesd values of voices when the buffer used to flush samples in microSD card (preventing loss of samples 43 microsec)

I have commented on files IO opreations ( bcz filename.flush() & filename.println() not supporting in SdFAt lib) i knew i thought of replacing with proper sintaxes later ( but i used serial monitor to see steps counting ! when the button are not pressed)

I though that you can understand the logical error and guide me