CanSat-C 2021 / Mbed 2 deprecated cansatC_test2_xbee

Dependencies:   ATP3012 mbed a HMC US015_2 getGPS

Revision:
20:72fbb99ad55a
Parent:
19:6c56feca386d
Child:
22:23d9592bca04
--- a/Function.h	Thu Dec 16 08:54:11 2021 +0000
+++ b/Function.h	Thu Dec 16 09:08:40 2021 +0000
@@ -96,6 +96,7 @@
 
 double AngleGet(double next_x, double next_y) 
 {
+    xbee.printf("\n\n\r----Angleget_start-----");
     double angle = 0;
     compass.setOpMode(HMC6352_CONTINUOUS, 1, 20);
     angle = compass.sample() / 10;
@@ -103,6 +104,7 @@
     double theta;
     double delta;
 
+    xbee.printf("next_cp_x=%lf, next_cp_y=%lf",next_x,next_y);
     xbee.printf("gps.latitude=%f, gps.longitude=%f\r\n", gps.latitude, gps.longitude);
     theta = atan2(next_y - gps.longitude , next_x - gps.latitude) * 180 / 3.14159265359;
     xbee.printf("theta=%f\r\n", theta);
@@ -117,7 +119,8 @@
     if(delta<0){
         delta+=360;
         }
-    printf("%f-%f=%f\r\n", angle, theta, delta); 
+    xbee.printf("%f-%f=%f\r\n", angle, theta, delta); 
+    xbee.printf("\n-----Angleget_finish-----");
     return delta;
 }