Hello World example for the EM-406 GPS library

Dependencies:   GPS mbed

Dependents:   BusNavigation

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "GPS.h"
00003 
00004 Serial pc(USBTX, USBRX);
00005 GPS gps(p9, p10);
00006 
00007 int main() {
00008     while(1) {
00009         if(gps.sample()) {
00010             pc.printf("I'm at %f, %f\n", gps.longitude, gps.latitude);
00011         } else {
00012             pc.printf("Oh Dear! No lock :(\n");
00013         }
00014     }
00015 }