![](/media/cache/profiles/asha_400twitter.jpg.50x50_q85.jpg)
this is test version get more data from GPS
main.cpp@2:b4e2a17ea09f, 2018-07-09 (annotated)
- Committer:
- Imashioyayoshiyuki
- Date:
- Mon Jul 09 07:14:39 2018 +0000
- Revision:
- 2:b4e2a17ea09f
- Parent:
- 1:9d198383f15c
- Child:
- 3:f4a976fcdfa8
??????GPS??????GYSFDMAXB??????
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
CanSat_C | 0:cc8b4152b0cf | 1 | #include "mbed.h" |
CanSat_C | 0:cc8b4152b0cf | 2 | #include "getGPS.h" |
CanSat_C | 0:cc8b4152b0cf | 3 | |
CanSat_C | 0:cc8b4152b0cf | 4 | Serial pc(USBTX, USBRX); |
CanSat_C | 0:cc8b4152b0cf | 5 | GPS gps(p28, p27); |
CanSat_C | 0:cc8b4152b0cf | 6 | |
CanSat_C | 0:cc8b4152b0cf | 7 | int main() |
CanSat_C | 0:cc8b4152b0cf | 8 | { |
CanSat_C | 1:9d198383f15c | 9 | pc.printf("\r\n\GPS Start\r\n"); |
CanSat_C | 1:9d198383f15c | 10 | |
CanSat_C | 1:9d198383f15c | 11 | /* 1秒ごとに現在地を取得してターミナル出力 */ |
CanSat_C | 0:cc8b4152b0cf | 12 | while(1) { |
CanSat_C | 1:9d198383f15c | 13 | if(gps.getgps()) //現在地取得 |
Imashioyayoshiyuki | 2:b4e2a17ea09f | 14 | pc.printf("(%lf, %lf)\r\n", gps.latitude, gps.longitude);//緯度と経度を出力 |
CanSat_C | 0:cc8b4152b0cf | 15 | |
CanSat_C | 0:cc8b4152b0cf | 16 | else |
Imashioyayoshiyuki | 2:b4e2a17ea09f | 17 | pc.printf("No data\r\n");//データ取得に失敗した場合 |
CanSat_C | 1:9d198383f15c | 18 | |
CanSat_C | 1:9d198383f15c | 19 | wait(1); |
CanSat_C | 0:cc8b4152b0cf | 20 | } |
CanSat_C | 0:cc8b4152b0cf | 21 | |
CanSat_C | 0:cc8b4152b0cf | 22 | return 0; |
CanSat_C | 0:cc8b4152b0cf | 23 | } |