I have recently purchased a Arduino Leonardo and Logger Shield. Unfortunately these do not play well together. I thought I'd start a thread dedicated to working out how to resolve this.
The key issue revolves around the Serial Peripheral Interface (SPI) on the Arduino Leonardo. Specifically; the Arduino Leonardo does not have any SPI pins connected to digital pins 10 through to 13 which the Logger Shield requires.
To resolve this problem you need to download the following library;
https://github.com/adafruit/SD
//WARNING WARNING WILL ROBINSON!!!
It is at this stage I'm stuck. From what I've read I need to replace my SD library with the one above. I've searched everywhere to find where my 'installed' library is located but with no success. I can add new libraries no problem.
If I can get past this hurdle then what changes do I need to make to the following sample code to get the ball rolling;
Code: Select all
#include <SD.h>
void setup(){
Serial.begin(9600);
Serial.println("Check");
pinMode(10, OUTPUT);
if (!SD.begin(10)) {
Serial.println("Fail");
return;
}
Serial.println("Pass");
}
void loop(){
File dataFile = SD.open("Test.txt", FILE_WRITE);
if (dataFile){
dataFile.println("Test");
dataFile.close();
Serial.println("Test");
delay(5000);
}
else{
Serial.println("Error");
}
}
Cheers
Jase