hello_world

Dependencies:   mbed

Fork of GPS_System_with_Google_Maps by Ifrah Saeed

Revision:
6:8cc48b05d20e
Parent:
3:3c7906d60f89
--- a/GPS.cpp	Fri Dec 14 15:40:21 2012 +0000
+++ b/GPS.cpp	Wed Jan 04 15:52:24 2017 +0000
@@ -22,8 +22,9 @@
 
 #include "GPS.h"
 
+
 GPS::GPS(PinName tx, PinName rx) : _gps(tx, rx) {
-    _gps.baud(4800);
+    _gps.baud(9600);
     longitude = 0.0;
     latitude = 0.0;
 }
@@ -35,8 +36,9 @@
 
     //return 1; //testing by Jigar
     while (1) {
+             //   pc.printf("\n\rentered the GPS.sample while loop\n\r");
         getline();
-        //printf("\n\rentered the GPS.sample while loop \n\r %s\n\r", msg);
+      //  pc.printf("\n\rentered the GPS.sample while loop \n\r %s\n\r", msg);
         
         
         // Check if it is a GPGGA msg (matches both locked and non-locked msg)
@@ -79,7 +81,7 @@
                 float degrees = trunc(latitude / 100.0f);
                 float minutes = latitude - (degrees * 100.0f);
                 latitude = degrees + minutes / 60.0f;
-                 degrees = trunc(longitude / 100.0f ); //degrees = trunc(longitude / 100.0f * 0.01f);
+                degrees = trunc(longitude / 100.0f ); //degrees = trunc(longitude / 100.0f * 0.01f);
                 minutes = longitude - (degrees * 100.0f);
                 longitude = degrees + minutes / 60.0f;
                 return 1;
@@ -100,9 +102,10 @@
 }
 
 void GPS::getline() {
-    
+     
+     //pc.printf("entered the getline loop\n\r");
     while (_gps.getc() != '$');   // wait for the start of a line
-    // printf("entered the getline loop\n\r");
+    // pc.printf("entered the getline loop\n\r");
     for (int i=0; i<256; i++) {
         msg[i] = _gps.getc();
         if (msg[i] == '\r') {