1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-30 16:24:09 +03:00

SD library updates. Renaming makeDir() to mkdir(). Replacing example. Adding keywords.txt.

This commit is contained in:
David A. Mellis
2010-11-20 12:31:49 -05:00
parent fcc4188b15
commit 5af5619df4
5 changed files with 61 additions and 116 deletions

View File

@ -0,0 +1,36 @@
#include <SD.h>
File f;
void setup()
{
Serial.begin(9600);
Serial.print("Initializing SD card...");
SD.begin();
Serial.println("done.");
f = SD.open("test.txt", true, false);
if (f) {
Serial.print("Writing to test.txt...");
f.println("testing 1, 2, 3.");
f.close();
Serial.println("done.");
} else {
Serial.println("error opening test.txt");
}
f = SD.open("test.txt");
if (f) {
Serial.println("test.txt:");
while (f.available()) Serial.write(f.read());
f.close();
} else {
Serial.println("error opening test.txt");
}
}
void loop()
{
}