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: ATP3012 mbed TB6612FNG HMC6352 US015 getGPS
main.cpp
- Committer:
- ushiroji
- Date:
- 2021-10-23
- Revision:
- 1:f6d4f374b130
- Parent:
- 0:5a1b52164bbe
- Child:
- 3:74d0faefdd78
File content as of revision 1:f6d4f374b130:
#include "mbed.h"
#include "TB6612.h"
#include "ATP3011.h" 
#include "getGPS.h"
#include "HMC6352.h"
#include "Avoid.h"
#include "FrontGet.h"
#include "AngleGet.h"
int main() {
    // 変数宣言
    int CP_num;           // CPリストのインデックス
int last_num;         // CPリストの最後の要素のインデックス
double GPS_x, GPS_y;  // 現在地の座標
double *pGPS_x = &GPS_x, *pGPS_y = &GPS_y;
double direction;     // 次CPへの向き
double CPs_x[] = [];  // CPリスト(x座標)
double CPs_y[] = [];  // CPリスト(y座標)
double next_CP_x, next_CP_y;
// 行動フロー開始
last_num = sizeof(CPs_x) / sizeof(double) - 1;
while (next_CP_x != CPs_x[last_num] && next_CP_y != CPs_y[last_num]) {
    int i;
    for (i = CP_num, last_num, i++) {
    // 移動
    位置情報を取得();
    方向取得();
    回転();
    while(i >= 5)   // 5°ずれると方向転換する
    {
        
        
    }
    motor(1)
    while (True) {
        前方取得();
        if (/* 障害物あり */) 停止()
        回避行動();
        else 移動();
        位置情報を取得();
        if (next_CP_x = GPS_x &&next_CP_y = GPS_y) blake;
            }
        }
        // 行動フロー終了
    }