Robert !
Tegnap este 23 óra körül végre megoldódott . Végül az " Arduino index fórumon " kaptam segítséget , ahol a 3250. hozzászólással indítottam .Most reggel akartam ide a Tavir fórumba írni, hogy senkit ne sétáltassak meg feleslegesen , mert az nem szép dolog. Most túl gyors voltál.
Ezt a programot kaptam :
Kód: Egész kijelölése
,---,-,-,-----
/*
SD card read/write
This example shows how to read and write data to and from an SD card file
The circuit:
* SD card attached to SPI bus as follows:
** MOSI - pin 11
** MISO - pin 12
** CLK - pin 13
** CS - pin 4 (for MKRZero SD: SDCARD_SS_PIN) // ÁTTETTEM D10LÁBRA
created Nov 2010
by David A. Mellis
modified 9 Apr 2012
by Tom Igoe
This example code is in the public domain.
*/
#include <SPI.h>
#include <SD.h>
File myFile;
void setup() {
// Open serial communications and wait for port to open:
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
Serial.print("Initializing SD card...");
if (!SD.begin(10)) { // ÁTÍRTAM 10 re
Serial.println("initialization failed!");
return;
}
Serial.println("initialization done.");
// open the file. note that only one file can be open at a time,
// so you have to close this one before opening another.
myFile = SD.open("datalog.csv", FILE_WRITE);
// if the file opened okay, write to it:
if (myFile) {
Serial.print("Writing to datalog.csv...");
myFile.println("testing 1, 2, 3.");
// close the file:
myFile.close();
Serial.println("done.");
} else {
// if the file didn't open, print an error:
Serial.println("error opening datalog.csv");
}
// re-open the file for reading:
myFile = SD.open("datalog.csv");
if (myFile) {
Serial.println("datalog.csv:");
// 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 datalog.csv");
}
}
void loop() {
// nothing happens after setup
}
--,-,-,-,-,-,--,-,--,
Ezt kellett változtatnom :
Kód: Egész kijelölése
** CS - pin 4 (for MKRZero SD: SDCARD_SS_PIN) // ÁTTETTEM D10. LÁBRA
if (!SD.begin(10)) { // ÁTÍRTAM 10 re
Mint írtam elsőre nem sikerült, de a másik kártyaolvasóval igen. Itt az eredmény :
-,,-,-,-,-,-,-
Initializing SD card...initialization done.
Writing to datalog.csv...done.
datalog.csv:
testing 1, 2, 3.
testing 1, 2, 3.
testing 1, 2, 3.
testing 1, 2, 3.
testing 1, 2, 3.
testing 1, 2, 3.
testing 1, 2, 3.
testing 1, 2, 3.
testing 1, 2, 3.
testing 1, 2, 3.
testing 1, 2, 3.
testing 1, 2, 3.
-,-,----,-,-,
Mindkét kártyaolvasó új , és mindkét kártya FAT16.-ra formázott és működnek .
Ha megtudom a hiba pontos okát , akkor megírom.
Amiket írtál, azt még nekem értelmeznem kell . Még nem értem a 60 napos tananyag végére.
Próbáltam képet beszúrni, de nem sikerült.