#include <SD.h>
#include <SPI.h>
// set up variables using the SD utility library functions:
Sd2Card card;
Sd2Card card1;
const int chipSelect = BUILTIN_SDCARD;
const int chipSelect1 = 10;
void setup()
{
pinMode(chipSelect1, OUTPUT);
SPI.setMOSI(7); // Shield has MOSI on pin 7
SPI.setMISO(12); // Shield has MISO on pin 12
SPI.setSCK(14); // Shield has SCK on pin 14
// Open serial communications and wait for port to open:
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}
Serial.print("\nInitializing SD card...");
if (!card.init(SPI_HALF_SPEED, chipSelect)) {
Serial.println("initialization failed.");
} else {
Serial.println("Wiring is correct and the card is present.");
}
Serial.print("\nInitializing SD card1...");
if (!card1.init(SPI_HALF_SPEED, chipSelect1)) {
Serial.println("initialization failed.");
} else {
Serial.println("Wiring is correct and the card 1 is present.");
}
}
void loop() {
// put your main code here, to run repeatedly:
}