yei
Dependencies: interface mbed enc_1multi calPID motorout KondoServoLibrary
Fork of cat18_operate by
Diff: main.cpp
- Revision:
- 18:05f5a3323bda
- Parent:
- 16:b2358fd35999
- Child:
- 19:48c3af917932
--- a/main.cpp Thu Aug 16 04:29:07 2018 +0000 +++ b/main.cpp Fri Aug 17 00:10:25 2018 +0000 @@ -9,6 +9,10 @@ //debug用に追加 #include "interface.h" #include "coordinate.h" + +const int kWait_ms = 500; + +//#define FORDEBUG ///setup関連を集めた void Setups(); void Tests(); @@ -23,7 +27,12 @@ DEBUG("main start"); InterruptSetup(); int worknum = 0; + +#ifdef FORDEBUG + for(int i = kCommonStart; i < kCommonStart + kCommonAreaNum - 2; i++) work[i].is_exist = 0; +#endif while( (worknum = CalPickPlace()) != 23 ) { + Close(); //ワークに向かう DEBUG("worknum %d, color %d, area %d, position %f, %f, %f\r\n", worknum, work[worknum].color, work[worknum].areaname, work[worknum].position[0],work[worknum].position[1],work[worknum].position[2]); DEBUG("go to work\r\n"); @@ -32,9 +41,10 @@ //掴む Close(); DEBUG("above\r\n"); - wait(1); + wait_ms(kWait_ms); //上に持ち上げる - Above(); + Above(work[worknum].areaname); + wait_ms(kWait_ms); //取り上げたことを保存 work[worknum].is_exist = 0; //シュート位置計算 @@ -46,11 +56,11 @@ DEBUG("open\r\n"); //放す Open(); - wait(0.5); + wait_ms(kWait_ms); DEBUG("above\r\n"); //上に持ち上げる - Above(); - wait(0.1); + Above(BOX); + wait_ms(kWait_ms); DEBUG("finish\r\n"); //置いたことを保存 shootingbox[boxspace].is_exist = 1; @@ -61,14 +71,14 @@ { GoSetup(); SetupPosition(); - StartCheck(); + StartCheck(); } void Tests() { static int count = 0; count ++; if (count > 100000) { - + count =0; } } \ No newline at end of file