GPS,LPC,xbee==
Dependencies: mbed LPS25HB_I2C
Revision 1:bfd9df900c4f, committed 2022-08-05
- Comitter:
- kosukesuzuki
- Date:
- Fri Aug 05 10:29:38 2022 +0000
- Parent:
- 0:f20bcf1efbc2
- Commit message:
- ?
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r f20bcf1efbc2 -r bfd9df900c4f main.cpp --- a/main.cpp Fri Aug 05 06:25:10 2022 +0000 +++ b/main.cpp Fri Aug 05 10:29:38 2022 +0000 @@ -6,8 +6,8 @@ #include "math.h" //GPSで使用 -Serial xbee(PA_9, PA_10); //xbee pin -Serial gps(PA_9,PA_10); //GPS後で変える +Serial xbee(PB_6, PB_7); //xbee pin +//Serial gps(D1,D0); //GPS後で変える Serial pc(USBRX,USBTX); //衛星側のpin I2C i2c(D0,D1); //気圧 pin @@ -31,13 +31,14 @@ float dataAl[10]; //気圧 標高 float dataTe[10]; //気圧 温度 +/* //GPSセンサ float dataLat[10]; //GSP 緯度 float dataLon[10]; //GPS 経度 float dataH[10]; //GPS ジオイド高さ - +*/ - +/* //GPS Timer timer_open; @@ -53,6 +54,7 @@ int cnt_gps; int Cnt_GPS=0; +*/ int main() { //1 @@ -88,6 +90,7 @@ ave = sum/10; xbee.printf("0 altitude = %f\r\n",ave); + /* //GPS while(1){ //2 if(gps.readable()){ //3 @@ -108,10 +111,10 @@ /*******************************/ - goto lav; + //goto lav; /*******************************/ - + /*//koko }else{//6 //printf("%s\r\n",gps_data); @@ -126,7 +129,7 @@ lav: //goto lav;より - + /**************************************************************/ @@ -143,6 +146,7 @@ char cmd1 = xbee.getc(); + /* //↓↓↓継続してGPSをとるため if(gps.readable()){ //3 gps_data[cnt_gps]=gps.getc(); @@ -169,7 +173,7 @@ } //3 if(timer_log.read()>=30.0*60.0) timer_log.reset(); } //2 - + */ @@ -191,6 +195,7 @@ for(i=0;i<10;i++){ //データ10回とる //5 + /* if(gps.readable()){ //6 gps_data[cnt_gps]=gps.getc(); if(gps_data[cnt_gps]=='$' || cnt_gps==256){ //7 @@ -229,6 +234,7 @@ if(timer_log.read()>=30.0*60.0) timer_log.reset(); + */ //GPS float pressure = ps.readPressureMillibars(); float altitude = ps.pressureToAltitudeMeters(pressure); @@ -244,7 +250,8 @@ //ここで保存と表示する for(i=0;i<10;i++){ //5 - xbee.printf("time = %f, Lat,Lon %f,%f gH = %f, Pa = %f, Al = %f, Te = %f\r\n",t.read(),dataLat[i],dataLon[i],dataH[i],dataPa[i],dataAl[i],dataTe[i]); + //xbee.printf("time = %f, Lat,Lon %f,%f gH = %f, Pa = %f, Al = %f, Te = %f\r\n",t.read(),dataLat[i],dataLon[i],dataH[i],dataPa[i],dataAl[i],dataTe[i]); + xbee.printf("time = %f,Pa = %f, Al = %f, Te = %f\r\n",t.read(),dataPa[i],dataAl[i],dataTe[i]); } //5 @@ -269,10 +276,12 @@ } //2 } //1 - +/* float _DMS2DEG(float raw_data){//GPSで使用 //1 float bb = raw_data/100; int d=(int)bb; float m=(raw_data-(float)d*100); return (float)d+m/60; -} //1 \ No newline at end of file +} //1 + +*/ \ No newline at end of file