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 MODSERIAL FATFileSystem
Diff: MbedLogger/MbedLogger.hpp
- Revision:
- 32:f2f8ae34aadc
- Child:
- 34:9b66c5188051
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/MbedLogger/MbedLogger.hpp Wed Dec 20 13:52:50 2017 +0000
@@ -0,0 +1,41 @@
+#ifndef MBEDLOGGER_HPP
+#define MBEDLOGGER_HPP
+
+#include "mbed.h"
+#include <string>
+using namespace std;
+
+#include "DirectoryList.h"
+
+class MbedLogger {
+public:
+ MbedLogger(); //constructor
+ void createTestLog(); //test log function
+
+ //one log file type for now
+ void createFile();
+
+ //save float array to file (append each time)
+ void saveArrayToFile(float *input);
+
+ //save the sequence title to file (append each time)
+ void saveSequenceStringToFile(string str_input);
+
+ //print the data to the serial terminal
+ void printFromLogFile();
+
+ //print the directory to the screen
+ void printMbedDirectory();
+
+ //close the current file stream [before creating a new one]
+ void closeFile();
+
+private:
+ int _f; //file name number
+ char _file_name[128]; //file name placeholder
+ int _file_number;
+
+ FILE *_fp; //the file is a class member variable
+};
+
+#endif
\ No newline at end of file