Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of dgps by
Diff: main.cpp
- Revision:
- 42:c78632c16d54
- Parent:
- 40:7b4d6043f533
- Parent:
- 41:df156ae5631b
- Child:
- 44:2ae602b89961
diff -r 7b4d6043f533 -r c78632c16d54 main.cpp --- 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