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.
Revision 2:19c8f66ab10f, committed 2020-12-19
- Comitter:
- aihara
- Date:
- Sat Dec 19 09:57:10 2020 +0000
- Parent:
- 1:fb92cf1c694b
- Commit message:
- a;
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Sat Dec 19 08:19:25 2020 +0000
+++ b/main.cpp Sat Dec 19 09:57:10 2020 +0000
@@ -18,25 +18,29 @@
double distance;
pc.printf("GPS begin\n");
-
- while(1){
- GPS gps (D1,D0);
+ wait(2);
+ GPS gps (D1,D0);
+ while(1){
if(gps.getgps()){
/*a,bを緯度経度の初期値で初期化*/
a = gps.latitude;
b = gps.longitude;
- Serial xbee(D1,D0);
+ wait(2);
+ Serial xbee(D1,D0);//Xbeeのピン
pc.printf("get1");
break;
}else{
- Serial xbee(D1,D0);
+ wait(2);
+ Serial xbee(D1,D0);//Xbeeのピン
pc.printf("Fault_No_Data1\r\n");
wait(1);
}
- }
- while(1){
- GPS gps (D1,D0);
+ }
+ //wait(2);
+ //GPS gps (D1,D0);
+ while(1){
if(gps.getgps()){
+ wait(2);
Serial xbee(D1,D0);//Xbeeのピン
printf("get2");
@@ -74,6 +78,7 @@
}//データ取得失敗を表示、通信、1秒待機
}
+
pc.printf("成功\n");
return 0;
}
\ No newline at end of file