sasasa

Dependencies:   HMC6352 PID eeprom mbed

Fork of ver1_2_2_1 by ryo seki

Revision:
2:09fabba6c00d
Parent:
1:89408fff7cc9
Child:
3:b4fb2b5365a7
--- a/main.h	Sun Mar 10 07:31:31 2013 +0000
+++ b/main.h	Fri Apr 05 07:26:42 2013 +0000
@@ -10,15 +10,22 @@
 #define ON      1
 #define OFF     0
 
-#define MOT1    1.0
-#define MOT2    1.0
-#define MOT3    1.0
-#define MOT4    1.0
+#define MOT1    1.0             //60  3.0 0.0 0.5 1.0
+#define MOT2    1.0             //120 0.0 3.0 1.0 0.0
+#define MOT3    1.0            //240 0.6 0.0 0.0 3.0
+#define MOT4    1.0             //300 0.0 0.8 3.0 0.0
 
 #define OUT_LIMIT   30.0
 #define MAX_POW     100
 #define MIN_POW     -100
 
+#define SHINPUKU 40
+
+#define FULL 0
+
+
+
+
 DigitalOut led1(LED1); 
 DigitalOut led2(LED2);
 DigitalOut led3(LED3);
@@ -29,7 +36,8 @@
 DigitalIn StartButton(p21);
 DigitalIn CalibEnterButton(p22);
 DigitalIn CalibExitButton(p23);
-PID pid(0.59, 1.0, 0.015, RATE);      //30.0 0.35 1.0 0.012 30.0 0.42 1.0 0.013 
+DigitalIn EEPROMButton(p24);
+PID pid(0.35, 0.0, 0.012, RATE);      //30.0 0.35 1.0 0.012 30.0    0.42 1.0 0.013 
 Ticker pidUpdata;
 Ticker IR;
 Ticker ultrasonic;
@@ -51,7 +59,11 @@
 extern int Distance;
 extern int IR_found;
 extern double ball_sankaku[16][2];
+extern double turn_sankaku[16][2];
 extern double ultrasonicVal[3];
+float now_compass =20.0;
+float past_compass;
+int turn_flag = 0;
 
 extern void Ultrasonic(void);
 extern void IR_Position(void);
@@ -59,7 +71,9 @@
 extern void array(int,int,int,int);
 
 enum{
-    HOME_WAIT,
-    DIFFENCE,
+    NONE,
+    SNAKE,
+    ATTACK,
+    SEARCH
 };