2017.11伊豆大島共同打ち上げ実験のデータ取得&保存用プログラム
Dependencies: BMP180 MPU6050 SDFileSystem mbed
Fork of SDFileSystem_HelloWorld by
Revision 8:8b7e9aa3a2fc, committed 2017-11-10
- Comitter:
- oichan
- Date:
- Fri Nov 10 13:14:11 2017 +0000
- Parent:
- 7:5f8080485160
- Commit message:
- flight model
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 5f8080485160 -r 8b7e9aa3a2fc main.cpp --- a/main.cpp Sun Nov 05 09:41:40 2017 +0000 +++ b/main.cpp Fri Nov 10 13:14:11 2017 +0000 @@ -46,11 +46,12 @@ int main() { +// pc.printf("Hello, Happy World!\r\n"); oshirase2.output(); oshirase1 = 0; oshirase2 = 0; twe.baud(115200); - twe.printf("Hello World!\n"); + twe.printf("Hello World!\r\n"); mpu.setAcceleroRange(0); bmp.Initialize(64,BMP180_OSS_ULTRA_LOW_POWER); mkdir("/sd/mydir", 0777); @@ -127,31 +128,41 @@ if(Time > 60*30){ timer.reset(); } + +// twe.printf("phase:%d,max altitude:%f\r\n",Phase,Max_Alt); /* GPS取得&送信 */ +// twe.printf("0"); gps_data[cnt_gps] = gps.getc(); +// twe.printf("1"); if(gps_data[cnt_gps] == '$' || cnt_gps ==256){ +// twe.printf("2"); cnt_gps = 0; memset(gps_data,'\0',256); }else if(gps_data[cnt_gps] == '\r'){ float world_time, lon_east, lat_north; int rlock, sat_num; char lat,lon; +// twe.printf("3"); if(sscanf(gps_data,"GPGGA,%f,%f,%c,%f,%c,%d,%d",&world_time,&lat_north,&lat,&lon_east,&lon,&rlock,&sat_num)>=1){ if(rlock==1){ +// twe.printf("4"); lat_north = _DMS2DEG(lat_north); lon_east = _DMS2DEG(lon_east); - twe.printf("phase:%d,max altitude:%f\r\n",Phase,Max_Alt); twe.printf("%s\r\n",gps_data); twe.printf("Lat:%f,Lon:%f\r\ntime:%f,sat_num:%d\r\n",lat_north,lon_east,world_time,sat_num); - }else{ twe.printf("phase:%d,max altitude:%f\r\n",Phase,Max_Alt); + }else{ +// twe.printf("5"); twe.printf("%s\r\n",gps_data); + twe.printf("phase:%d,max altitude:%f\r\n",Phase,Max_Alt); } } }else{ cnt_gps++; +// twe.printf("6"); } +// twe.printf("Hi!"); } } @@ -230,6 +241,7 @@ int _input(char moji){ if(moji!='\0'){ twe.printf("%c\r\n",c); +// pc.printf("%c\r\n"); } if(moji=='f'){ return -1;