Hi,
I have multiple tabs within this code. The code is for a display and for data logging to an SD card. But, when I add in the line " if (!card.init(SPI_HALF_SPEED, chipSelect)){ " the display stops showing the correct values and instead shows 0.00 .
here is my code (not in full, just the card.h tab)
// code for SD card
#include <SD.h>
#include <SPI.h>
#include "setting.h"
Sd2Card card;
SdVolume volume;
SdFile root;
const char chipSelect=(10,11,12,13);
void setup2() {
Serial.print("\nInitializing SD card...");
pinMode(53, OUTPUT);
if (!card.init(SPI_HALF_SPEED, chipSelect)){ // This line stops display working
Serial.println("initialization failed. Things to check:");
Serial.println("* is a card inserted?");
Serial.println("* is your wiring correct?");
Serial.println("* did you change the chipSelect pin to match your shield or module?");
return;
} else {
Serial.println("Wiring is correct and a card is present.");
return;
}
}
It would be great if anyone could help me get the display and SD working alongside eachother,
Thank you