Skip to content

Commit 59ff54d

Browse files
added file close after writing to file
Was not able to read the contents of the file as it had not been closed.
1 parent 50f30b3 commit 59ff54d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

libraries/CurieSerialFlash/examples/FileWrite/FileWrite.ino

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ void setup() {
3333
file = SerialFlash.open(filename);
3434
file.write(contents, strlen(contents) + 1);
3535
Serial.println("String \"" + String(contents) + "\" written to file " + String(filename));
36+
file.close();
3637
}
3738

3839
bool create_if_not_exists (const char *filename) {

0 commit comments

Comments
 (0)