I have 2 SD cards wired up on a breadboard and connected to my WT-SC01.
Currently they are wired up to share the MISO/MOSI/CLK pins and they have separate CS pins.
SD1 is using pin 4
SD2 is using pin 12
(I am using the esp32-micro-sdcard library)
I begin my code by calling:
As far as i know, the CS pins on a SD card are active LOW, so it should be
// digitalWrite(4, LOW); // this is not needed initially since begin(4) calls this also
digitalWrite(12, HIGH);
SD.begin(4,xx,xx,xx);
and then
SD.end(); // this is probably not needed either
digitalWrite(4, HIGH);
// digitalWrite(12, LOW); // again not needed.
SD.begin(12,xx,xx,xx);
between every action you would like to perform, you should switch both CS pins if you are not calling begin(), but i think it may be better to have to different pointers to 2 different objects, rather than just to use 'SD'
regardless, the SD library will not switch the CS pin HIGH for you when it is done, and unless you call begin() you will need to switch it LOW manually also.
Thank you Deva this is very informative.
I found out that my 2nd SD reader is not actually working (It is a different model to my first) So first thing I will buy another functioning one.
I will also create a 2nd SD object like you say since that makes a lot of sense.