From 05663a5ac76a422d9ac16a745623a5864eda84b0 Mon Sep 17 00:00:00 2001 From: bpmcgeeney Date: Thu, 4 Nov 2021 17:41:20 -0700 Subject: [PATCH] fixed file open error, it works! --- .vscode/extensions.json | 8 +++++--- include/teensy.h | 2 +- src/main.cpp | 4 +++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 78f8c5e..935f093 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,8 +1,10 @@ { + // See http://go.microsoft.com/fwlink/?LinkId=827846 + // for the documentation about the extensions.json format "recommendations": [ "ms-vscode.cpptools", - "wayou.vscode-todo-highlight", + "platformio.platformio-ide", "usernamehw.errorlens", - "platformio.platformio-ide" + "wayou.vscode-todo-highlight" ] -} \ No newline at end of file +} diff --git a/include/teensy.h b/include/teensy.h index 32e966f..fd68bc1 100644 --- a/include/teensy.h +++ b/include/teensy.h @@ -101,7 +101,7 @@ void write2CSV(outVector &stateVector, Vehicle &State) { } // Open simOut.csv - File dataFile = SD.open("simOut.csv"); + File dataFile = SD.open("simOut.csv", FILE_WRITE); if (dataFile) { Serial.println("File successfully opened!"); dataFile.println("It works!"); diff --git a/src/main.cpp b/src/main.cpp index 0c71335..2011f3e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -86,7 +86,9 @@ void loop() { init_Vehicle(State); Serial.println("Last run duration:" + String(millis() - last + " ms")); - delay(1000); + Serial.println("Sim Complete!"); + Serial.readString(); + Serial.println("Restarting Sim"); } }