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

Dependencies:   mbed AQM1602 HMC6352 PID

Revision:
10:6df631c39f9b
Parent:
9:c966191926c5
Child:
11:3efae754e6ef
--- a/setting/def.h	Tue Mar 08 09:52:22 2016 +0000
+++ b/setting/def.h	Thu Mar 10 03:03:50 2016 +0000
@@ -19,7 +19,7 @@
 //Lcd 設定値
 #define LCD_COLUMN_NUM 0x11
 #define BUFSIZE 7
-#define STATE_NUM_X 0x04
+#define STATE_NUM_X 0x08
 #define STATE_NUM_Y 0x10
 
 #define JUMP_TAG_MAX 0xFFFF
@@ -27,7 +27,7 @@
 #define ZERO_FUNCTION       0
 #define START               1
 #define GET_IR              2
-#define GET_LINE            3
+#define GET_SNS0            3
 #define GET_PID_VALUE       4
 #define CALIBRATION_ENTER   5
 #define CALIBRATION_EXIT    6
@@ -47,6 +47,12 @@
 #define SET_STRATEGY_UP     19
 
 #define DRIVE_KICKER 20
+#define DRIVE_DRIBBLER_AND_KICKER 21
+
+#define CALIBRATION_TURN 22
+#define RW_PID 23
+
+#define TURN_AND_START 24
 
 typedef struct {//for command
     char LcdStr[STATE_NUM_X][BUFSIZE];
@@ -100,6 +106,12 @@
 #define MIN_POW     -100
 #define PID_CYCLE   0.05   //s
 
+#define PID_OUT_MIN 5
+
+//hmc
+#define HMC_RUN 1
+#define HMC_RST 0
+
 //ir 
 //ir_pow_old
 #define IR_X 0
@@ -127,8 +139,8 @@
 #define DIS_7 0x7//high_value
 
 //ping
-#define L_PING 0
-#define R_PING 1
+#define L_PING 1
+#define R_PING 0
 #define F_PING 2
 #define B_PING 3
 
@@ -220,12 +232,14 @@
     uint8_t stopflag;
     uint8_t KickOffFlag;
     uint8_t DribbleFlag;
+    uint8_t BallHoldFlag;
     uint8_t BackHomeFlag;
+    uint8_t TurnStartFlag;
     uint8_t KickFlag;
     uint8_t MotorFlag;
     uint8_t IrFlag;
     uint8_t UswFlag;
-    uint8_t UswFlag_2;
+    uint8_t UswFlag2;
     uint8_t PidFlag;
     //blind//on...1/off...0
     uint8_t IrBlind;