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: mbed move4wheel2 EC CruizCore_R1370P
main.cpp
- Committer:
- la00noix
- Date:
- 2019-03-07
- Revision:
- 8:2ba338b4590e
- Parent:
- 7:44ce34007499
- Child:
- 9:7667dcfc7ce5
File content as of revision 8:2ba338b4590e:
#include "EC.h"
#include "R1370P.h"
#include "move4wheel.h"
#include "mbed.h"
#include "math.h"
#include "PathFollowing.h"
#include "movement.h"
#include "maxonsetting.h"
#include "manual.h"
#include "can.h"
#define PI 3.141592
//#define PROGRAM_INFO //プログラム使用時に使用プログラムの情報を最初に表示する際に定義
int go_waitmode = 0;
//-----mbed led------------------//点灯条件-----------------------//参照場所------------------------------//
//DigitalOut cansend_led(LED1); //canread -> on //can.cpp
//DigitalOut canread_led(LED2); //cansend -> on //can.cpp
//DigitalOut debug_led(LED3); //maxon debug programme -> on //maxonsetting.cpp
//////////////////////////////////////////////////////////////以下main文/////////////////////////////////////////////////////////////////
int main()
{
UserLoopSetting_maxon();
UserLoopSetting_sensor();
UserLoopSetting_can();
#ifdef PROGRAM_INFO //プログラム使用時に使用プログラムの情報を最初に表示
printf("ソースファイル名 : %s¥n", __FILE__);
printf("作成日付 : %s¥n", __DATE__);
printf("作成時刻 : %s¥n", __TIME__);
#endif
while(1) {
switch(id1_value[0]) {
//-----auto mode----------------------------------------------------------------------------------------------------------------------//
case 1:
switch(id1_value[6]) {
case 0:
//-----right mode-------------------------------------------------------------------------------------------------------------//
if(T1 == 0) {
//スタート位置からみかんの木まで移動
wait(0.5);
T1++;
}
if(T1 == 1) {
while(1) {
wait(0.5);
if(T1 == 2) {
break;
}
}
}
if(T1 == 2) {
//みかんの木から三宝置き場まで移動
T1++;
}
if(T1 == 3) {
while(1) {
wait(0.5);
if(T1 == 4) {
break;
}
}
}
if(T1 == 4) {
//三宝置き場からりんごの木まで移動
wait(0.5);
T1++;
}
if(T1 == 5) {
while(1) {
wait(0.5);
if(T1 == 6) {
break;
}
}
}
if(T1 == 6) {
//りんごの木からお供え台まで移動
wait(0.5);
T1++;
}
break;
case 1:
//-----left mode--------------------------------------------------------------------------------------------------------------//
break;
}
//-----wait mode----------------------------------------------------------------------------------------------------------------------//
case 0:
calc_xy(0,1,1);
ashi_led();
MaxonControl(0,0,0,0);
go_waitmode = 0;
break;
//-----manual mode--------------------------------------------------------------------------------------------------------------------//
case 2:
ManualOut(250,100,500,200);
go_waitmode = 0;
break;
}
//------------------------------------------------------------------------------------------------------------------------------------//
}
}