kk
Dependencies: SDFileSystem mbed
Fork of cansat_kk by
Diff: main.cpp
- Revision:
- 3:efaa785283a6
- Parent:
- 2:be9046fb5859
- Child:
- 4:cfaf33b2c97a
--- a/main.cpp Mon Feb 29 18:07:55 2016 +0000 +++ b/main.cpp Mon Feb 29 18:36:45 2016 +0000 @@ -20,6 +20,7 @@ int i=0; char *gps_target = "$GPRMC,174813.000,A,3606.9349,N,13927.4196,E,0.42,221.65,280216,,,A*6D"; float longitude_target,latitude_target,gpstime_target,knot_target,angle_target; +int count=0; void gps_rx()//GPSデータ受信割り込み { @@ -71,22 +72,42 @@ switch (count) { case 0: - if( (target_angle+3)>=angle || (target_angle-3)<=angle ) - { - // - - } + //パラシュートを焼き切るまで待つ + //焼き切ったらcount+1 break; case 1: - 文2; + //落ちてパラシュートを焼き切った後 + if( (angle_target+3)>=angle || (angle_target-3)<=angle )//3は適当な数字。誤差範囲 + { + //角度が合ったらcount+1 + } + else + { + //角度が合うまで回転 + if(angle_target>=angle) + { + //differ_angle=angle_target-angle; + //moterlを動かす + } + else if(angle>=angle_target) + { + //differ_angle=angle-angle_target; + //moterrを動かす + } + } break; case 2: - 文n; + //目標地点の近くまで走行 + //目標地点に近づいたらcount+1 + break; + case 3: + //動作を停止。割り込みも停止させ、回収待ち + //moterl=moterr=0; + //ngps.detach(); break; default: - 文; break; - } + } } int main()