瀏覽代碼

Cosmetic improvements in CopyFromSD example

main
PaulStoffregen 9 年之前
父節點
當前提交
eab1268ead
共有 1 個檔案被更改,包括 9 行新增3 行删除
  1. +9
    -3
      examples/CopyFromSD/CopyFromSD.ino

+ 9
- 3
examples/CopyFromSD/CopyFromSD.ino 查看文件

@@ -2,7 +2,7 @@
#include <SD.h>
#include <SPI.h>

const int SDchipSelect = 4;
const int SDchipSelect = 4; // Audio Shield has SD card CS on pin 10
const int FlashChipSelect = 6;

void setup() {
@@ -67,6 +67,7 @@ void setup() {
Serial.print(" copying");
// copy data loop
unsigned long count = 0;
unsigned char dotcount = 9;
while (count < length) {
char buf[256];
unsigned int n;
@@ -74,9 +75,13 @@ void setup() {
ff.write(buf, n);
count = count + n;
Serial.print(".");
if (++dotcount > 100) {
Serial.println();
dotcount = 0;
}
}
ff.close();
Serial.println();
if (dotcount > 0) Serial.println();
} else {
Serial.println(" error opening freshly created file!");
}
@@ -86,7 +91,8 @@ void setup() {
f.close();
}
rootdir.close();

delay(10);
Serial.println("Finished All Files");
}



Loading…
取消
儲存