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: sd-driver_compatible_with_MAX32630FTHR
Fork of CircularBufferSDCardLib by
Revision 11:c70e8305ddd7, committed 2018-04-10
- Comitter:
- DVLevine
- Date:
- Tue Apr 10 23:49:52 2018 -0400
- Parent:
- 10:f5fdba83488a
- Child:
- 12:c09a50d9469a
- Commit message:
- Fixed SD Card. Get Kalman Angle and prox, with arbitrarily many data fields as needed now. Also added indicator light - red for logging, green for in process of saving. Blue is defautly there to let know that system IMU is working.
Changed in this revision
| dataRecorder.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/dataRecorder.cpp Sat Apr 07 04:57:09 2018 +0000
+++ b/dataRecorder.cpp Tue Apr 10 23:49:52 2018 -0400
@@ -7,6 +7,9 @@
//Initialize data quantity as 0
m_data_quantity = 0;
+
+ //initialize num fields
+ m_numDataFields = numDataFields;
}
@@ -92,8 +95,10 @@
printf("before logging, data quantity is %i\n",m_data_quantity);
- int numPoints = m_data_quantity; //add check for timestamps
+ int numPoints = m_data_quantity/m_numDataFields; //add check for timestamps
+ printf("numPoints %i \n ",numPoints);
+
vector<int> indexArr(numPoints);
//int indexArr[numPoints];
@@ -103,6 +108,7 @@
}
vector<uint32_t> timeArr(numPoints);
+ vector<uint16_t> dataEntry(m_numDataFields); //created before loop to see if prevent data collision
vector<vector <uint16_t> > allDataArr(numPoints);
//uint32_t timeArr[numPoints];
@@ -111,14 +117,15 @@
for (int i = 0; i < numPoints; i++){
//time aggregation
timeArr[i] = popLastTimeStamp();
-
+
//data aggregation
- vector<uint16_t> dataEntry(m_numDataFields);
+ // vector<uint16_t> dataEntry(m_numDataFields);
for (int j=0;j<m_numDataFields;j++){
- dataEntry[i] = popLastDataPoint();
+ dataEntry[j] = popLastDataPoint();
+ printf("%i\n",dataEntry[j]);
}
allDataArr[i] = dataEntry;
- printf("%i\n",static_cast<int>(dataEntry[0]));
+ // printf("%i\n",static_cast<int>(dataEntry[0]));
}
printf("Before launch! size test %i \n",indexArr.size());
