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: mbed HMC6352 US015 TB6612FNG2 getGPS ATP3011
catchGPS.h
- Committer:
- user_
- Date:
- 2021-10-24
- Revision:
- 6:1cda8471adc3
- Parent:
- 3:74d0faefdd78
- Child:
- 9:9221ef8d36a8
File content as of revision 6:1cda8471adc3:
// 現在地の座標を返す関数
#include "mbed.h"
#include "getGPS.h"
Serial pc(USBTX, USBRX);
GPS gps(D1, D0);
int catchGPS(double *GPS_x, double *GPS_y)
{
pc.printf("\r\n\GPS Start\r\n");
/* 1秒ごとに現在地を取得してターミナル出力 */
while(1) {
if(gps.getgps()) //現在地取得
pc.printf("%lf %lf\r\n", gps.latitude, gps.longitude);//緯度と経度を出力
*GPS_x= gps.latitude
*GPS_y= gps.longitude
else
pc.printf("No data\r\n");//データ取得に失敗した場合
wait(1);
}
return 0;
}