0% found this document useful (0 votes)
8 views

S Dread Write

The document includes code to open a file on an SD card and read data from it. It initializes the SD card, opens a file, and uses a loop to read the file and send the data to the serial port.

Uploaded by

pctech16
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

S Dread Write

The document includes code to open a file on an SD card and read data from it. It initializes the SD card, opens a file, and uses a loop to read the file and send the data to the serial port.

Uploaded by

pctech16
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

#include <SD.h> #include <Streaming.

h> File myFile; int qC; char inputTXT;

void setup() { // Open serial communications and wait for port to open: Serial.begin(9600); Serial.print("Initializing SD card..."); pinMode(10, OUTPUT); if (!SD.begin(10)) { 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()) { if (Serial.write(myFile.read()) = i){ i++

void loop() { if(countqC == Serial.write(myFile.read())) { Serial.print()countqC;

} else{

} }

You might also like