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 1:2f83b463e872, committed 2020-12-19
- Comitter:
- aihara
- Date:
- Sat Dec 19 13:20:45 2020 +0000
- Parent:
- 0:b54d41dacf49
- Commit message:
- h;
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Sat Dec 19 07:22:27 2020 +0000
+++ b/main.cpp Sat Dec 19 13:20:45 2020 +0000
@@ -8,7 +8,7 @@
Serial pc(SERIAL_TX,SERIAL_RX,921600);//通信
Serial xbee(D1,D0);//Xbeeのピン
-GPS gps (D1,D0);
+//GPS gps (D1,D0);
int main()
@@ -19,10 +19,10 @@
pc.printf("GPS begin\n");
- while(1){
- if(gps.getgps()){
+ //while(1){
+ // if(gps.getgps()){
/*a,bを緯度経度の初期値で初期化*/
- a = gps.latitude;
+ /* a = gps.latitude;
b = gps.longitude;
pc.printf("get1");
break;
@@ -34,13 +34,18 @@
while(1){
if(gps.getgps()){
printf("get2");
-
+ */
/*ここから距離の計算*/
/*c、dを得た緯度経度の値で初期化*/
double c;
double d;
- c = gps.latitude;
- d = gps.longitude;
+ a=1;
+ b=2;
+ c=3;
+ d=4;
+ distance=5;
+ // c = gps.latitude;
+ // d = gps.longitude;
const double pi = 3.14159265359;//円周率
@@ -60,15 +65,17 @@
/*距離が25m以上なら表示、通信*/
if(distance>=30){
pc.printf("run over 20m");
- break;
+ // break;
}
- }else {
+ // }
+ else {
pc.printf("False_No_Data2\r\n");
wait(1);
}//データ取得失敗を表示、通信、1秒待機
- }
- pc.printf("成功\n");
+ //}
+ pc.printf("finish!\n");
+ // pc.printf("成功\n");
return 0;
}
\ No newline at end of file