NHK2017Ateamかにろぼ
Dependencies: 2017NHKpin_config mbed FEP HMC6352 MotorDriverController PID QEI omni
\ ̄\ / ̄/ /l \ \ / / lヽ | ヽ ヽ | | / / | \ ` ‐ヽ ヽ ● ● / / ‐ / \ __ l | ||___|| / l __ / \ \ / \/ /\| 人__人 |/\ //\| |/\\ //\| |/\\ / . \_____/ \ ┏┓ ┏━┓┏┓ ┏┓ ┏┓┏┓ ┏┓ ┏┓┗┛ ┏┓ ┗┓┃┗┛ ┏┛┗━┓ ┃┃┃┃ ┃┃┏━┛┗┓┏┓┏┛┗━┓┃┃┏┓┏┓┏━━━┓ ┗┓┏━┛ ┃┃┗┛ ┃┃┗━┓┏┛┗┛┗┓┏┓┃┗┛┗┛┃┃┗━━━┛ ┏┛┃┏━┓┃┗━━┓┃┃┏━┛┗┓ ┏┛┃┃┃ ┃┃ ┃┏┛┗━┛┗━━┓┃┃┃┃┏┓┏┛ ┗━┛┃┃ ┃┃┏┓ ┃┃┏━━┓┏━━┛┃┃┃┃┗┛┃ ┏┛┃ ┃┃┃┗━━┓ ┗┛┗━━┛┗━━━┛┗┛┗━━┛ ┗━┛ ┗┛┗━━━┛
Diff: bot/controller/controller.h
- Revision:
- 1:269914e0aa07
- Parent:
- 0:757e9800c103
- Child:
- 2:ea151e05033a
--- a/bot/controller/controller.h Mon Aug 21 12:20:14 2017 +0000 +++ b/bot/controller/controller.h Tue Aug 22 05:07:57 2017 +0000 @@ -3,15 +3,51 @@ #include "mbed.h" #include "pin_config.h" +#include <math.h> #include "FEP.h" +#define M_PI 3.141592653589793 #define ADDR 000 -class Controller : public FEP { +/** @def + * FEP受信成功 + */ +#define FEP_SUCCESS 0 + +/** @def + * スティック生値を割る数 + */ +#define STICK_DIVIDE 255.0 + +/** @def + * スティックニュートラルの範囲 + */ +#define STICK_NEWTRAL 0.1 + +/** @def + * スティックの距離の限界 + */ +#define STICK_NORM_MAX 1.0 + +class Controller : public FEP +{ public : Controller(); + + void receiveState(); private : + void getStickData(); + + char data[6]; + uint8_t fepTemp; +protected : + bool Button1[7]; + bool Button2[6]; + double stick[4]; + double degree[2]; + double norm[2]; + double vector[2]; }; #endif//CONTROLLER_H \ No newline at end of file