変な加速
Diff: P_motor.h
- Revision:
- 0:29872002539b
- Child:
- 1:d0b60b54e3bd
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/P_motor.h Fri Oct 20 09:56:12 2017 +0000 @@ -0,0 +1,36 @@ +#ifndef P_motor_h_ +#define P_motor_h_ + +#include "mbed.h" +#include "T_motor.h" + +class P_motor +{ + private: + T_motor motor; + Timer timer; + Serial pc; + double output[3]; + double target, output_m; + double time_old; + double RC, LC; + void compute(); + void calc(); + void timer_reset(); + void output_reset(double value = 0); + enum status + { + NONE, + FORWARD, + BACKWARD = -1 + }stat, stat_old; + + public: + P_motor(I2C *i2c_, char addr_); + P_motor& operator=(double target_); + void run(); + void free(); + void stop(); +}; + +#endif \ No newline at end of file