Context: i have two files on an SD card, file A and File B. in the Set up void, i am opening one file, reading the contents, closing and then repeating it for the second file.
I then later on in the void loop, try to write to the SD card File C and file D.
i open the file, write and close, and repeat.
so far i am only able to read A and B, or Write C and D, i am not able to do both in the same sketch.
CODE:
void setup() {
SD.begin(53);
Data_logger = SD.open("A.txt");
while (Data_logger.available())
{
A_sd_read = Data_logger.read();
// do stuff with the stuff
}
Data_logger.close();
// read B
Data_logger = SD.open("B.txt");
while (Data_logger.available())
{
PWM_sd_read[i] = Data_logger.read();
// do stuff with the stuff
}
Data_logger.close();
}
void loop() {
Data_logger_reg = SD.open("C.txt",FILE_WRITE);
Data_logger_reg.print(C_Stuff);
}