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.
gps.h
00001 int gpscnt = 0; 00002 00003 00004 00005 void gpscal() 00006 { 00007 00008 if(gpscnt<10){ 00009 lats = gps.lat; //latt=37.541230; //37.540553; 00010 lons = gps.lon; // lont=127.079819; // 127.078038; 00011 gpscnt++; 00012 } 00013 00014 latt = lats; //37.5409023;// 00015 lont = lons; //127.0800591;// 00016 00017 latp = gps.lat; 00018 lonp = gps.lon; 00019 00020 dlat = latp - latt; 00021 dlon = lonp - lont; 00022 00023 //GPSASCII(); 00024 00025 /* 00026 //jarak ke tujuan..... 00027 latp=latp*3.14/180; //ftoa(latp, 1, dst); putstr3(dst); putchar3('\n'); 00028 latt=latt*3.14/180; //ftoa(latt, 1, dst); putstr3(dst); putchar3('\n'); 00029 lonp=lonp*3.14/180; //ftoa(lonp, 1, dst); putstr3(dst); putchar3('\n'); 00030 lont=lont*3.14/180; //ftoa(lont, 1, dst); putstr3(dst); putchar3('\n'); 00031 d_lat=latp-latt; 00032 d_lon=lonp-lont; 00033 a=(sin(d_lat/2))*(sin(d_lat/2))+cos(latt)*cos(latp)*(sin(d_lon/2))*(sin(d_lon/2)); 00034 //c=2*atan2(sqrt(a),sqrt(1-a)); 00035 //d=r*c; 00036 c=2*asin(sqrt(a)); 00037 d=c*180*60*1000/3.14*1.852; // d = distance to target 00038 // if(d > 5000 || d < -5000) d = ld; 00039 gps.dist = d; 00040 00041 //sudut hadap ke tujuan.... 00042 //b=atan2(sin(d_lon)*cos(latp), cos(latt)*sin(latp)-sin(latt)*cos(latp)*cos(d_lon)); 00043 b=(acos((sin(latt)-sin(latp)*cos(c))/(sin(c)*cos(latp))))*180/3.14; 00044 if (b==360)b=0; 00045 gps.bear = b; 00046 00047 ld = d; 00048 GPSASCII(); 00049 */ 00050 00051 }
Generated on Sun Jul 17 2022 00:27:14 by
