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.
Diff: main.cpp
- Revision:
- 1:fb92cf1c694b
- Parent:
- 0:b54d41dacf49
- Child:
- 2:19c8f66ab10f
--- a/main.cpp Sat Dec 19 07:22:27 2020 +0000
+++ b/main.cpp Sat Dec 19 08:19:25 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()
@@ -20,19 +20,24 @@
pc.printf("GPS begin\n");
while(1){
+ GPS gps (D1,D0);
if(gps.getgps()){
/*a,bを緯度経度の初期値で初期化*/
a = gps.latitude;
b = gps.longitude;
+ Serial xbee(D1,D0);
pc.printf("get1");
break;
}else{
+ Serial xbee(D1,D0);
pc.printf("Fault_No_Data1\r\n");
wait(1);
}
}
while(1){
+ GPS gps (D1,D0);
if(gps.getgps()){
+ Serial xbee(D1,D0);//Xbeeのピン
printf("get2");
/*ここから距離の計算*/
@@ -57,7 +62,7 @@
distance = earth_radius*theta_r;//距離の計算
- /*距離が25m以上なら表示、通信*/
+ /*距離が25m以上なら表示、通信*/
if(distance>=30){
pc.printf("run over 20m");
break;