Hello all.
I have a custom library called StringWrite (derived from SD library) that I want to put on minima core folder like this
the content:
utility folder content
StringWrite.cpp
#include "StringWrite.h"
File myFile;
short int StringWrite(String fichier, String phrase){
phrase = phrase + '\n'; //controle de la longueur fait par les fonctions ?
if (!SD.begin(4)) { // PIN PAR DEFAUT DU SD dans src/utility/Sd2Card.h --- en lien avec "pin_arduino.h" -> a renommer plus tard par pin_yamr64a
//Serial.println("initialization failed!");
return -1;
}
myFile = SD.open(fichier, FILE_WRITE);
if (myFile) {//si myFile==true = si fichier ouvert sans erreur
//Serial.print(phrase);
myFile.print(phrase);
myFile.close();
//Serial.println("done.");
return 1;
}
else {return 0;}
}
and StringWrite.h
#ifndef STRINGWRITE_H
#define STRINGWRITE_H
// #include "String.h"
#include "SPI.h"
#include "SD.h"
short int StringWrite(String fichier, String phrase);
#endif // FIN
But, the problem is when I try to test the function, I got this compilation error
So I tried to manually add the "SPI" path library folder on my StringWrite.h file ("../../libraries/SPI/SPI.h") and I got this time lot of error:
The thing I don't understand is that, when I decide to put my custom library folder on the default Arduino Library folder, everything goes right, compilation success.
So I have the feeling that SPI folder and other make problem when I put my function on arduino cores, but my programming level is not enought to understand why.
So need help to solve it please.
EDIT: this is my file
StringWrite.zip (49,1 Ko)