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

main.cpp

Committer:
DVLevine
Date:
2018-04-04
Revision:
2:c2cfb0ebc3bd
Parent:
0:ebe71c7e7854
Child:
3:df8fb1b5d868

File content as of revision 2:c2cfb0ebc3bd:

#include "mbed.h"
#include "sdCardReader.h"
#include "dataRecorder.h"


static const char *sd_file_path = "/sd/out.txt";

DataRecorder* boba = new DataRecorder();
static SDCardReader soba;// = new SDCardReader();

//For SDCard 
// Set up the button to trigger an erase
InterruptIn irq(BUTTON1);      
DigitalOut led1(LED1);

// main() runs in its own thread in the OS
int main() {
    //create value (16 bit like prox reading)
     
     uint16_t a = 123;
     uint16_t b = 2034;
     uint16_t c = 1040;
     uint16_t d = 8;
     uint16_t e = 980;
     
   
    boba->LogDistancePoint(a);
    boba->LogDistancePoint(b);
    boba->LogDistancePoint(c);
    boba->LogDistancePoint(d);
    boba->LogDistancePoint(e);
    
    //printf("ERE IS %i \n",ere);

    boba->saveLoggedDataAndClearBuffer("SUPERDATAYO.txt"); 
     
    led1 = !led1;
     
}