Main Program

Dependencies:   mbed AQM1602 HMC6352 PID

Revision:
24:9fb74ea3c25d
Parent:
23:d95d8d3e89f3
Child:
26:fbb03281fc7d
--- a/setting/def.h	Sat Jan 30 10:08:47 2016 +0000
+++ b/setting/def.h	Sat Jan 30 16:05:58 2016 +0000
@@ -29,23 +29,29 @@
 #define DUTY_COLOR  3
 #define DUTY_MOUSE  4
 
-//MPU6050関連
-//config.h
-
 /*PID処理*/
 #define RATE    0.052//52
-#define PID_BIAS    0.0
+#define PID_BIAS    1.0
 #define REFERENCE   180.0
 #define MINIMUM     0.0
 #define MAXIMUM     359.9
-#define P_GAIN  1.4//1.4    //0.78   
+#define P_GAIN  1.25//0.8    //0.78   
 #define I_GAIN  0.0     //0.0
-#define D_GAIN  0.05  //0.009
+#define D_GAIN  0.01  //0.009
 #define OUT_LIMIT   30.0
 #define MAX_POW     100
 #define MIN_POW     -100
 #define PID_CYCLE   0.05   //s
 
+//ir 
+#define IR_X 0
+#define IR_Y 1
+#define IR_SHORT 0
+#define IR_LONG 1
+
+#define X_AXIS 0
+#define Y_AXIS 1
+
 //思考パターン
 #define STRATEGY_NUM 12
 
@@ -63,15 +69,19 @@
     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 AvailableKick;
+    uint8_t KickFlag;
     int32_t mouse[2];//0...x,1...y//1cm nearlyeq 1000count
+    //motor 
+    int32_t motorlog[2];
     //cmps&pid
     double cmps, CmpsInitialValue, CmpsDiff, FrontDeg;//0<x<360
     double InputPID;//<<gyrosensor
-    uint16_t OutputPID;//>>motor
+    int16_t OutputPID;//>>motor
     //uint8_t color[3];
     //uint8_t lcdpoint[2];//0...x,1...y
     uint8_t strategy;