ジャパンオープン用のメインプログラム

Dependencies:   mbed AQM1602 HMC6352 PID

Revision:
11:3efae754e6ef
Parent:
10:6df631c39f9b
Child:
12:bee8f883c33a
--- a/setting/def.h	Thu Mar 10 03:03:50 2016 +0000
+++ b/setting/def.h	Thu Mar 10 08:26:33 2016 +0000
@@ -1,6 +1,10 @@
 #ifndef _DEF_H_
 #define _DEF_H_
 
+//red or green
+#define RED_CAT
+//#define GREEN_CAT
+
 //BT(BlueTooth)
 #define DATA_NUM 8+2//2byte→KEYCODE(拝啓)とCHECKCODE(敬具) 8byte→やりとりするデータ
 #define TX_KEYCODE 0xAA//あちらのKEYCODE
@@ -53,6 +57,7 @@
 #define RW_PID 23
 
 #define TURN_AND_START 24
+#define CALIBRATION_ENTER_OR_EXIT 25
 
 typedef struct {//for command
     char LcdStr[STATE_NUM_X][BUFSIZE];
@@ -144,6 +149,9 @@
 #define F_PING 2
 #define B_PING 3
 
+#define X_PING 0
+#define Y_PING 1
+
 //0,1...main
 //2,3...debug board
 
@@ -156,6 +164,17 @@
 #define LINE_RF 5
 #define LINE_DELAY 0.5
 
+#ifdef RED_CAT
+#define LINE_FIX 0x0
+#define LINE_FREE 0x7
+#endif /*RED_CAT*/
+
+#ifdef GREEN_CAT
+#define LINE_FIX 0x7
+#define LINE_FREE 0x0
+#endif /*GREEN_CAT*/
+
+
 //思考パターン
 #define STRATEGY_NUM 12
 
@@ -166,38 +185,6 @@
 #define RAD2DEG(rad)  (180.0(rad)/PI)
 
 //データ
-/*
-typedef struct {//ir,line,gyro,mouse,ping
-    //ping
-    uint8_t ping[4];
-    //ir
-    uint8_t irKey;
-    uint8_t irNotice;
-    uint8_t irSpot[2];
-    uint8_t irPosition;
-    uint8_t IrFlag;
-    //line
-    uint8_t lnFlag[3];
-    uint8_t ball;
-    uint8_t KickOffFlag;
-    //uint8_t LineBind[4];//宣言すると動かない⇒構造体の限界
-    uint8_t KickFlag;
-    //motor 
-    int32_t motorlog[2];
-    uint8_t MotorFlag;
-    double s_pow;
-    double l_pow;
-    //cmps&pid
-    uint8_t PidFlag;
-    double cmps, CmpsInitialValue, CmpsDiff, FrontDeg;//0<x<360
-    double InputPID;//<<gyrosensor
-    int16_t OutputPID;//>>motor
-    uint8_t strategy;
-    uint8_t init_point_flag;
-    uint8_t stopflag;
-} Record;
-*/
-//NewStruct
 typedef struct {
     //cmps&pid
     double cmps, CmpsInitialValue, CmpsDiff, FrontDeg;//0<x<360
@@ -210,6 +197,10 @@
     //line
     uint8_t lineSpot[3];
     uint8_t lnFlag[3];
+    uint8_t lnHold;
+    uint8_t lnRaw;
+    uint8_t lnStop[4];
+    uint8_t FieldState;//0...outside,1...inside
     /*uint8_t LineFlag[3];
     uint8_t LinePriority[3];
     uint8_t LineBind[3];*/