Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Diff: main.cpp
- Revision:
- 3:147e7a35d2c3
- Parent:
- 2:7cb9c966a781
- Child:
- 4:54544a7dcbe0
--- a/main.cpp Thu Feb 16 16:00:18 2017 +0000
+++ b/main.cpp Thu Feb 16 17:33:01 2017 +0000
@@ -20,7 +20,7 @@
int US4_mean[MAX]={0,0,0,0,0,0,0,0,0,0};
int US5_mean[MAX]={0,0,0,0,0,0,0,0,0,0};
-std::string telemFile; //file holding info about
+std::string telemFile; //file holding info about telem data gathered since last power on
void setActiveUS(int chan);
@@ -78,7 +78,10 @@
return result; //should just do "return [operation that gives result];" for efficiency
}
+// Opens set file for logging, appends some data, then returns.
+//
void telemSave(std::string data) {
- std::ofstream file;
-
+ std::ofstream stream;
+ stream.open(telemFile, std::ios::app);
+ stream << data;
}
\ No newline at end of file