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

Committer:
DVLevine
Date:
Wed Apr 04 17:15:36 2018 -0400
Revision:
3:df8fb1b5d868
Parent:
2:c2cfb0ebc3bd
Child:
4:fe6d2823b7cb
Corrected a lot of small errors. Stil some more left.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
DVLevine 0:ebe71c7e7854 1 #include "mbed.h"
DVLevine 0:ebe71c7e7854 2 #include "dataRecorder.h"
DVLevine 0:ebe71c7e7854 3
DVLevine 0:ebe71c7e7854 4 DataRecorder* boba = new DataRecorder();
DVLevine 0:ebe71c7e7854 5
DVLevine 0:ebe71c7e7854 6 //For SDCard
DVLevine 3:df8fb1b5d868 7 // Set up the button
DVLevine 3:df8fb1b5d868 8 InterruptIn irq(PF_2);
DVLevine 3:df8fb1b5d868 9 DigitalOut led1(PE_0);
DVLevine 0:ebe71c7e7854 10
DVLevine 0:ebe71c7e7854 11 // main() runs in its own thread in the OS
DVLevine 0:ebe71c7e7854 12 int main() {
DVLevine 0:ebe71c7e7854 13 //create value (16 bit like prox reading)
DVLevine 0:ebe71c7e7854 14
DVLevine 0:ebe71c7e7854 15 uint16_t a = 123;
DVLevine 0:ebe71c7e7854 16 uint16_t b = 2034;
DVLevine 0:ebe71c7e7854 17 uint16_t c = 1040;
DVLevine 0:ebe71c7e7854 18 uint16_t d = 8;
DVLevine 0:ebe71c7e7854 19 uint16_t e = 980;
DVLevine 3:df8fb1b5d868 20
DVLevine 3:df8fb1b5d868 21 uint32_t ta = 2121;
DVLevine 3:df8fb1b5d868 22 uint32_t tb = 8181;
DVLevine 3:df8fb1b5d868 23 uint32_t tc = 6262;
DVLevine 3:df8fb1b5d868 24 uint32_t td = 3535;
DVLevine 3:df8fb1b5d868 25 uint32_t te = 1212;
DVLevine 0:ebe71c7e7854 26
DVLevine 3:df8fb1b5d868 27 boba->logDistancePoint(a);
DVLevine 3:df8fb1b5d868 28 boba->logDistancePoint(b);
DVLevine 3:df8fb1b5d868 29 boba->logDistancePoint(c);
DVLevine 3:df8fb1b5d868 30 boba->logDistancePoint(d);
DVLevine 3:df8fb1b5d868 31 boba->logDistancePoint(e);
DVLevine 3:df8fb1b5d868 32
DVLevine 3:df8fb1b5d868 33 boba->logTimeStamp(a);
DVLevine 3:df8fb1b5d868 34 boba->logTimeStamp(b);
DVLevine 3:df8fb1b5d868 35 boba->logTimeStamp(c);
DVLevine 3:df8fb1b5d868 36 boba->logTimeStamp(d);
DVLevine 3:df8fb1b5d868 37 boba->logTimeStamp(e);
DVLevine 3:df8fb1b5d868 38
DVLevine 0:ebe71c7e7854 39
DVLevine 0:ebe71c7e7854 40 //printf("ERE IS %i \n",ere);
DVLevine 2:c2cfb0ebc3bd 41
DVLevine 2:c2cfb0ebc3bd 42 boba->saveLoggedDataAndClearBuffer("SUPERDATAYO.txt");
DVLevine 0:ebe71c7e7854 43
DVLevine 0:ebe71c7e7854 44 led1 = !led1;
DVLevine 0:ebe71c7e7854 45
DVLevine 0:ebe71c7e7854 46 }
DVLevine 0:ebe71c7e7854 47