GPS

Dependencies:   C12832_lcd GPS mbed

Fork of mbed_gps by Gideon Adekunle

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 #include "C12832_lcd.h"
00004 C12832_LCD lcd;
00005  
00006 //Serial pc(USBTX, USBRX);
00007 GPS gps(p9, p10);
00008  
00009 int main() {
00010     while(1) {
00011         lcd.cls();
00012         lcd.locate(3,3);
00013         if(gps.sample()) 
00014         {
00015             lcd.printf("I'm at %f, %f\n", gps.longitude, gps.latitude);
00016         } 
00017         else 
00018         {
00019         lcd.cls();
00020         lcd.locate(3,3);
00021         lcd.printf("Oh Dear!");
00022         }
00023         wait(1);
00024     }
00025 }
00026