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.
Dependencies: ATP3012 mbed a HMC US015_2 getGPS
Diff: Function.h
- Revision:
- 20:72fbb99ad55a
- Parent:
- 19:6c56feca386d
- Child:
- 22:23d9592bca04
diff -r 6c56feca386d -r 72fbb99ad55a Function.h
--- 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;
}