K64F based data logger for GPS (ublox MAX M8Q) & 6 Axis Sensor (FXOS8700Q) - Outputs to SD + UDP - Uses FRDM K64F + ublox "Cellular and positioning shield" (3G version)

Dependencies:   MAX_M8Q_Capture EthernetInterface FXOS8700Q SDFileSystem eCompass_FPU_Lib mbed-rtos mbed

main.cpp

Committer:
rlinnmoran
Date:
2015-03-27
Revision:
0:77857a36b4ff
Child:
2:bcd60a69583f

File content as of revision 0:77857a36b4ff:

#include "mbed.h"
#include "meta.h"

extern int eCompass_init(void);


Serial pc(USBTX, USBRX);


int main(void)
{
    printf("Setting up eComapss\r\n");   
    if (eCompass_init())
        printf("Issue setting up compass\r\n");
    
    while(1){    
        printf("Creating MetaData Object\r\n");
        MetaData _metadata;
        
        printf("Creating CSV Output");
        _metadata.outputToCVSstring();
    
        printf("Save to CSV file");
        _metadata.appendSDcard();
        
        printf("###done####\r\n");
        
        wait(1);
    }
    
//    while(1);
}

/*

- Init routines for 6axis + GPS (none) + UDP + Filesystem

- Wait some time to let system settle

--> (loop re-entry)
- Create new MetaData object that goes off and samples 6axis and all GPS components (mainly RMC message)
--- In object code (constructor), include the code for 6axis + GPS
- Create string in CSV format from MetaData

#Improvement - add push button/led to start/stop data logging
- Append string to file
- Create new UDP frame from string
- Wait for 1 sec, loop to re-entry point.

*/

/* ### Error Log ###
e001 - GPS/Compass Function did not complete on MetaData class constructor
 */