A set of data recording functions to locally store data in a circular buffer, with functions for offloading to an SD Card when convenient. dataRecorderr.h shows accessible functions to the main program - all direct SD operations are abstracted away by the library. When using this library, #include dataRecorder.h

Dependencies:   sd-driver_compatible_with_MAX32630FTHR

Fork of CircularBufferSDCardLib by Daniel Levine

Revision:
10:f5fdba83488a
Parent:
9:a2ba4015796e
Child:
11:c70e8305ddd7
--- a/dataRecorder.cpp	Fri Apr 06 04:01:33 2018 +0000
+++ b/dataRecorder.cpp	Sat Apr 07 04:57:09 2018 +0000
@@ -1,7 +1,7 @@
 #include "dataRecorder.h"
 
 /* CONSTRUCTOR*/
-DataRecorder::DataRecorder(){
+DataRecorder::DataRecorder(int numDataFields){
   //Initialize SDCard Reader Class
   m_saveBuddy = new SDCardReader();
 
@@ -113,8 +113,10 @@
     timeArr[i] = popLastTimeStamp(); 
     
     //data aggregation
-    vector<uint16_t> dataEntry(1);
-    dataEntry[0] = popLastDataPoint(); 
+    vector<uint16_t> dataEntry(m_numDataFields);
+    for (int j=0;j<m_numDataFields;j++){
+        dataEntry[i] = popLastDataPoint(); 
+    }
     allDataArr[i] = dataEntry;
     printf("%i\n",static_cast<int>(dataEntry[0]));
   }