QC Control software

Dependencies:   mbed

Fork of dgps by Colin Stearns

Revision:
42:c78632c16d54
Parent:
40:7b4d6043f533
Parent:
41:df156ae5631b
Child:
44:2ae602b89961
--- a/main.cpp	Wed Apr 23 04:09:06 2014 +0000
+++ b/main.cpp	Wed Apr 23 04:16:46 2014 +0000
@@ -134,12 +134,16 @@
     getPS().openConnection();
     getPS().closeConnection();
     //Main Loop
+    int count = 0;
         while(1){
+            USB::getSerial().printf("Running GPS...\r\n");
             GPSHandle::getGPSHand().run();
             USB::getSerial().printf("Requesting commands from egg...\r\n");
-            wait_us(100000);
-            CommandHandle::getCommandHand().run();
-            wait_us(100000);
+            if(count % 100 == 0){
+                wait_us(100000);
+                CommandHandle::getCommandHand().run();
+                wait_us(100000);
+            }
             if(GPSHandle::getGPSHand().if_image_location()){
                 USB::getSerial().printf("Taking picture and sending...\r\n");
                 wait_us(100000);
@@ -147,10 +151,11 @@
                 USB::getSerial().printf("sent all data\r\n");
                 wait_us(100000);
                 GPSHandle::getGPSHand().next_waypoint();
+                wait_us(100000);
             }else{
                 USB::getSerial().printf("Not close enough to waypoint for image\r\n");
             }
-            wait_us(1000000);
+            count++;
         //}
 
         // Run image handler