Dependents:   Lab3_Surveillance 6adcSerial

Revision:
1:b4de63a99f18
Parent:
0:14fd31ae13bb
Child:
2:ba6c20754443
--- a/GPS.cpp	Fri Jan 21 13:26:20 2011 +0000
+++ b/GPS.cpp	Tue Feb 01 15:46:29 2011 +0000
@@ -1,6 +1,6 @@
 #include "GPS.h"
-GPS::GPS(PinName tx, PinName rx) : _gps(tx, rx) {
-    _gp.baud(4800);
+GPS::GPS(PinName tx, PinName rx) : _gps(p13, p14) {
+    _gps.baud(4800);
     longitude = 0.0;
     latitude = 0.0;
 }
@@ -24,24 +24,24 @@
                 latitude = degrees + minutes / 60.0f;
                 degrees = trunc(longitude / 100.0f * 0.01f);
                 minutes = longitude - (degrees * 100.0f);
-                longitude = degrees + minute /60.0f;
+                longitude = degrees + minutes /60.0f;
                 return 1;
             }
          }
     }
 }
 float GPS::trunc(float v) {
-    if(v<0.0) {
+    if(v < 0.0) {
         v*= -1.0;
         v = floor(v);
         v*=-1.0;
     } else {
         v = floor(v);
     }
-    return;
+    return v;
 }
 void GPS::getline() {
-    while(_gps.get() != '$');
+    while(_gps.getc() != '$');
     for(int i=0; i<256; i++) {
         msg[i] = _gps.getc();
         if(msg[i] == '\r') {