![](/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-09
- Revision:
- 9:4d0c81290638
- Parent:
- 8:8d26ce37febc
- Child:
- 10:43fc07923c7f
File content as of revision 9:4d0c81290638:
#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("\r\n#### Restart Timer #####"); tm t = gps.UTCTime(); printf("\r\n UTC Time is %d/%d/%d %d:%d", t.tm_mday , t.tm_mon , t.tm_year , t.tm_hour, t.tm_min); time_t seconds = time(NULL); printf("\r\nTime as a basic string = %s", ctime(&seconds)); t1.attach(&t1out,gps_interval); } int main() { serial.baud(9600); // full-speed! serial.printf("\r\n#### SD Card Initialization #####"); wait(1); ////////////////////// read Setup File ////////////////////////// readSetupFile(); gps_interval = (float)GPSInterval()/1000; Variable_Data_TypeDef * var_list = readVarFile(); logSystemData(gps_interval); unsigned int amount = getAmountVarList(); for (int i = 0; i < amount ; i++) { serial.printf("\r\n var name = %s ",var_list[i].varName); serial.printf("\r\n first addr name = %s ",var_list[i].varAddress); } /////////////////////////////////////////////////// serial.printf("\r\n#### End of SD Card Initialization #####"); gps.start_GPS(); t1.attach(&t1out,gps_interval); set_time(1256729737); // Set RTC time to Wed, 28 Oct 2009 11:35:37 while(1); }