Bonjour,
Je viens de voir un petit soucis et je ne vois pas ou je me trompe.
void setup() {
// 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("Initializing SD card...");
//***Ligne qui pose problème**********************
if (!SD.begin(4)) {
Serial.println("initialization failed!");
return;
}
//*******************************************
Serial.println("initialization done.");
// re-open the file for reading:
myFile = SD.open("test.txt");
if (myFile) {
Serial.println("test.txt:");
// read from the file until there's nothing else in it:
while (myFile.available()) {
Serial.write(myFile.read());
}
// close the file:
myFile.close();
} else {
// if the file didn't open, print an error:
Serial.println("error opening test.txt");
}
// reserve 200 bytes for the inputString:
inputString.reserve(200);
pinMode(inPin6, INPUT);
pinMode(inPin7, INPUT);
pinMode(13, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
Serial.print("freeMemory()=");
Serial.println(freeMemory());
digitalWrite(13,HIGH);
delay(1000);
}
Lorsque je rentre ce code avec la ligne SD.begin(4), je ne vois pas ma sortie 13 s'allumer alors qu'elle le devrait. J'ai une arduino uno r3 avec un shield ethernet avec un emplacement SD. Je ne me sert que de la carte sd dans ce projet.
Merci d'avance
Stéphane