robocup
Dependencies: HMC6352 PID mbed
Diff: IR.h
- Revision:
- 0:13ab960fc61f
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/IR.h Fri Mar 08 07:13:29 2013 +0000 @@ -0,0 +1,63 @@ + + +#define IR_TIME_NOTFOUND 833 /* 見つけられなかったと判断するまでの時間(単位:us) */ +#define IR_COUNTMAX 487 /*最大パルス幅 パルスの存在しうる最大時間は487us*/ +#define ALL_IR 9 +#define DIREC_IR 8 +#define DIRECTION 16 +#define TERM 0 +#define DELTA -2 +#define SWAP(type,a,b) { type temp = a; a = b; b = temp; } + + +/* 赤外線センサに使うpinを配列に格納 */ +PinName ir_num[ALL_IR] = { + p13, + p14, + p15, + p16, + p17, + p18, + p19, + p20, + p30 +}; + +int Convert_Direction[DIRECTION] = { + 90, + 67, + 45, + 22, + 0, + 337, + 315, + 292, + 270, + 247, + 225, + 202, + 180, + 157, + 135, + 112 +}; + +//ball direction +double ball_sankaku[16][2] = { + {0 , 1 }, + {0.390 , 0.920}, + {0.707 , 0.707}, + {0.927 , 0.374}, + {1 , 0 }, + {0.920 ,-0.390}, + {0.707 ,-0.707}, + {0.374 ,-0.927}, + {0 ,-1 }, + {-0.390,-0.920}, + {-0.707,-0.707}, + {-0.927,-0.374}, + {-1 , 0 }, + {-0.920, 0.390}, + {-0.707, 0.707}, + {-0.374, 0.927} +};