modifiche posizione iniziale e sistema d'allarme.

Dependencies:   MTK3339 TextLCD mbed tsi_sensor

Fork of app_gps by Dennis Morello

Revision:
6:c8efb299b0f0
Parent:
5:244867f8fc75
Child:
7:ffc4ef2442fa
--- a/main.cpp	Mon Jul 13 14:35:32 2015 +0000
+++ b/main.cpp	Mon Jul 13 14:53:57 2015 +0000
@@ -109,6 +109,16 @@
             stdevLat = stdev(coords[LAT], N);
             stdevLon = stdev(coords[LON], N);
             
+            if (3*stdevLat <= 0.00001 && 3*stdevLon <= 0.00001) {
+                initPos[LAT] = meanLat;
+                initPos[LON] = meanLon;
+                set = true;
+            }
+            
+            lcd.cls();
+            lcd.printf("%f\n%f %d", stdevLat, stdevLon, i);
+            
+            /*
             for (int j=0; j<N; j++) {
                 if (coords[LAT][j] > meanLat-stdevLat && coords[LAT][j] < meanLat+stdevLat &&
                     coords[LON][j] > meanLon-stdevLon && coords[LON][j] < meanLon+stdevLon)
@@ -120,6 +130,7 @@
                 initPos[LON] = coords[LON][i%N];
                 set = true;
             }
+            */
         }
         
         i++;