demo of GPS receive using interrupt
Dependencies: GPS_INT MODSERIAL mbed
Revision 0:ceb6a2e3c82c, committed 2018-07-11
- Comitter:
- j_rocket_boy
- Date:
- Wed Jul 11 16:52:39 2018 +0000
- Commit message:
- Sample for "GPS_INT" library
Changed in this revision
diff -r 000000000000 -r ceb6a2e3c82c GPS_INT.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/GPS_INT.lib Wed Jul 11 16:52:39 2018 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/j_rocket_boy/code/GPS_INT/#9d9e62cebda8
diff -r 000000000000 -r ceb6a2e3c82c MODSERIAL.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/MODSERIAL.lib Wed Jul 11 16:52:39 2018 +0000 @@ -0,0 +1,1 @@ +http://os.mbed.com/users/Sissors/code/MODSERIAL/#da0788f0bd77
diff -r 000000000000 -r ceb6a2e3c82c main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Wed Jul 11 16:52:39 2018 +0000 @@ -0,0 +1,42 @@ +// -*- coding: utf-8 -*- +/** + @file main.cpp + @brief Sample for "GPS_INT" library + + @author D.Nakayama + @version 1.0 + @date 2018-07-12 D.Nakayama Written for C++/mbed. + + + @see + Copyright (C) 2018 D.Nakayama. + Released under the MIT license. + http://opensource.org/licenses/mit-license.php + using device Nucleo-F401RE and GMS7-CR6 +*/ + +#include "mbed.h" +#include "GPS_INT.h" +#include "MODSERIAL.h" + +MODSERIAL pc(USBTX, USBRX); // tx, rx +GPS_INT gps(D8, D2); // tx, rx + +int main() { + printf("hello gps!\n"); + while(1) { + if(gps.location_is_update()){ + printf("UTC :%04d/%02d/%02d %02d:%02d:%02d\n",gps.t.tm_year + 1900, gps.t.tm_mon + 1, gps.t.tm_mday, gps.t.tm_hour, gps.t.tm_min, gps.t.tm_sec); + printf("longitude :%f\n",gps.lon); + printf("latitude :%f\n",gps.lat); + printf("PDOP :%.1f\n",gps.PDOP); + printf("HDOP :%.1f\n",gps.HDOP); + printf("VDOP :%.1f\n",gps.VDOP); + printf("lock :%d\n",gps.lock); + printf("n_sat :%d\n",gps.n_sat); + printf("h_see :%.1f\n",gps.h_see); + printf("h_geo :%.1f\n",gps.h_geo); + printf("\n"); + } + } +}
diff -r 000000000000 -r ceb6a2e3c82c mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Wed Jul 11 16:52:39 2018 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/a7c7b631e539 \ No newline at end of file