Linkit ONE 讀取GPS紀錄並寫入SPI flash
Linkit ONE 讀取GPS紀錄並寫入SPI flash #include "LGPS.h" #include "LTask.h" #include "LFlash.h" #include "LSD.h" #include "LStorage.h" #define Drv LFlash // use Internal 10M Flash // #define Drv LSD // use SD card gpsSentenceInfoStruct info; //Global define the GPS parameters char buff[256]; double latitude; double longitude; double height=0; int tmp, year, month, day, hour, minute, second, num ; char datestamp[12]; char timestamp[12]; double bearing=0 ; double velocity=0 ; static unsigned char getComma(unsigned char num,const char *str) { unsigned char i,j = 0; int len=strlen(str); for(i = 0;i < len;i ++) { if(str[i] == ',') j++; if(j == num) return i + 1; } return 0; } static double getDoubleNumber(const char *s) { char buf[10]; unsigned char i; double rev; i=getComma(1, s); i = i - 1; strncpy(buf, s, i); buf[i] = 0; rev=atof(buf); return rev...