t k
/
frdm_k64f_serialgps
FRDM-K64F+NEO-6M-GPS Serial GPS Add Beijing time format
Diff: main.cpp
- Revision:
- 0:52831af60170
diff -r 000000000000 -r 52831af60170 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri Aug 12 08:16:18 2016 +0000 @@ -0,0 +1,18 @@ +/* Example showing how to hook up to different GPS modules (GlobalSat neo-6m)*/ +#include "mbed.h" +#include "GPS.h" +//create usb serial +Serial pc(USBTX, USBRX); +//creat gps serial baud is 9600 +GPS gpsAda(PTC15, PTC14, 9600); + +int main() +{ + while (1) { + if(gpsAda.sample()){ + pc.printf("%f\t%c\t%f\t%c\t%f\t%f\t%f\n\r",gpsAda.longitude, gpsAda.ns,gpsAda.latitude,gpsAda.ew, gpsAda.alt, gpsAda.geoid, gpsAda.time); + pc.printf("%d:%d:%d",gpsAda.hour,gpsAda.minute,gpsAda.seconed); + } + } + +} \ No newline at end of file