![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Initial Publish Leaning GPS/SDCARD
Dependencies: FileManager GPSGms6 SDFileSystem mbed
Fork of 2545_SD_Card by
main.cpp
- Committer:
- Lucyjungz
- Date:
- 2016-05-06
- Revision:
- 3:78eaf4291b84
- Parent:
- 2:c96b02fcb98e
- Child:
- 4:aa7ac2ac6913
File content as of revision 3:78eaf4291b84:
/* 2545_SD_Card Example Example of writing data to SD card. Based on FTF2014_lab4 Example https://developer.mbed.org/teams/Freescale/wiki/FTF2014_workshop Craig A. Evans, University of Leeds, Mar 2016 */ #include "mbed.h" #include "SDFileSystem.h" #include "GPSGms6.h" #include "FileManager.h" // Connections to SD card holder on K64F (SPI interface) SDFileSystem sd(PA_7, PA_6, PA_5, PA_0, "sd"); // MOSI, MISO, SCK, CS Serial serial(USBTX, USBRX); // for PC debug GPSGms6 gps; Timeout t1; DigitalOut myled(LED1); float gps_interval = 3; void t1out(void) { myled = !myled; printf("\r\nGps header = %s", gps.latestGPRMC().header); printf("\r\nGps status = %s", gps.latestGPRMC().status); printf("\r\nGps time = %s", gps.latestGPRMC().time); printf("\r\nGps date = %s", gps.latestGPRMC().date); printf("\r\nGps lat = %s", gps.latestGPRMC().latitude); printf("\r\nGps long = %s", gps.latestGPRMC().longitude); printf("\r\nGps indicator = %s", gps.latestGPRMC().indicator); logGPSData( gps.latestGPRMC().date, gps.latestGPRMC().time); serial.printf("\n#### Restart Timer #####"); t1.attach(&t1out,gps_interval); } int main() { serial.baud(9600); // full-speed! serial.printf("\n#### SD Card Initialization #####"); // wait(1); ////////////////////// read Setup File ////////////////////////// readSetupFile(); gps_interval = (float)GPSInterval()/1000; logSystemData(gps_interval); /////////////////////////////////////////////////// serial.printf("\n End of SD Card Initialization "); t1.attach(&t1out,gps_interval); while(1); }