It uses 3 serial port one for GPS second for GSM and third for viewing what is happing. GPS longitude, latitude, north-south, east-west is extracted and SMS is send to the number saved in the program about GPS longitude, latitude, north-south, east-west and displayed on LCD.SMS is also retrieved and deleted.

Dependents:   BusNavigation

Fork of GPS by Simon Ford

Revision:
1:5c5177f8c0d8
Parent:
0:15611c7938a3
--- a/GPS.cpp	Tue Jun 08 14:10:27 2010 +0000
+++ b/GPS.cpp	Fri Oct 31 05:15:22 2014 +0000
@@ -22,20 +22,21 @@
  
 #include "GPS.h"
 
+
 GPS::GPS(PinName tx, PinName rx) : _gps(tx, rx) {
-    _gps.baud(4800);    
+    _gps.baud(9600);    
     longitude = 0.0;
     latitude = 0.0;        
 }
 
 int GPS::sample() {
     float time;
-    char ns, ew;
+    //char ns, ew;
     int lock;
 
     while(1) {        
         getline();
-
+        
         // Check if it is a GPGGA msg (matches both locked and non-locked msg)
         if(sscanf(msg, "GPGGA,%f,%f,%c,%f,%c,%d", &time, &latitude, &ns, &longitude, &ew, &lock) >= 1) { 
             if(!lock) {
@@ -48,7 +49,8 @@
                 float degrees = trunc(latitude / 100.0f);
                 float minutes = latitude - (degrees * 100.0f);
                 latitude = degrees + minutes / 60.0f;    
-                degrees = trunc(longitude / 100.0f * 0.01f);
+                //degrees = trunc(longitude / 100.0f * 0.01f);
+                degrees = trunc(longitude / 100.0f );
                 minutes = longitude - (degrees * 100.0f);
                 longitude = degrees + minutes / 60.0f;
                 return 1;