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
Diff: main.cpp
- Revision:
- 0:c61c6e4775ca
- Child:
- 1:3c11e07da92a
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Wed Feb 13 03:02:19 2019 +0000
@@ -0,0 +1,120 @@
+#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 //プログラム使用時に使用プログラムの情報を最初に表示する際に定義
+
+#define HARUROBO_TEST_MODE //テスト自動プログラム(練習・動作確認用)使用時に定義
+//#define HARUROBO_RIGHT_MODE //本番用自動プログラム(右側フィールド)使用時に定義
+//#define HARUROBO_LEFT_MODE //本番用自動プログラム(左側フィールド)使用時に定義
+
+int go_waitmode = 0;
+
+//-----mbed led------------------//点灯条件-----------------------//参照場所------------------------------//
+//DigitalOut canread_led(LED1); //canread -> on //can.cpp
+//DigitalOut cansend_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:
+
+//-----テスト自動プログラム(練習・動作確認用--------------------------------------------------------------------//
+#ifdef HARUROBO_TEST_MODE
+
+ if(go_waitmode == 0){
+
+ purecurve(1,1,1,
+ 0,0,
+ 1000,1000,
+ 9,
+ 1000,5,0.1,10,0.1,500,0);
+ gogo_straight(1,1,
+ 1000,1000,
+ 1000,2000,
+ 1000,1000,
+ 5,0.1,10,0.1,600,0);
+ MaxonControl(0,0,0,0);
+
+ go_waitmode = 1;
+
+ }else if(go_waitmode == 1){
+
+ MaxonControl(0,0,0,0);
+
+ }
+
+
+#endif
+//--------------------------------------------------------------------------------------------------------//
+
+
+
+
+//-----本番用自動プログラム(右側フィールド用)-------------------------------------------------------------------//
+#ifdef HARUROBO_RIGHT_MODE
+
+ //ここに本番用自動プログラム(右側フィールド用)を書く
+
+#endif
+//---------------------------------------------------------------------------------------------------------//
+
+
+
+//-----本番用自動プログラム(左側フィールド用)-------------------------------------------------------------------//
+#ifdef HARUROBO_LEFT_MODE //
+
+ //ここに本番用自動プログラム(左側フィールド用)を書く
+
+#endif
+//---------------------------------------------------------------------------------------------------------//
+ MaxonControl(0,0,0,0);
+ break;
+
+//-----wait mode----------------------------------------------------------------------------------------------------------------------//
+ case 0:
+
+ calc_xy(0,1,1);
+ ashi_led();
+ MaxonControl(0,0,0,0);
+
+ break;
+
+//-----manual mode--------------------------------------------------------------------------------------------------------------------//
+ case 2:
+
+ ManualOut(250,100,500,200);
+
+ break;
+//------------------------------------------------------------------------------------------------------------------------------------//
+ }
+}
+}
\ No newline at end of file