田中くんのモタドラを制御する石本さんのやつ
Diff: T_motor.h
- Revision:
- 0:e10d08530490
- Child:
- 1:5bd161b83ce0
diff -r 000000000000 -r e10d08530490 T_motor.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/T_motor.h Sun Aug 13 02:08:40 2017 +0000 @@ -0,0 +1,19 @@ +#ifndef T_motor_H +#define T_motor_H + +class T_motor +{ + private: + I2C i2c; + char addr; + public: + void setAddr(int addr_); + void init(char addr,int freq); + T_motor(PinName sda,PinName scl,int addr); + T_motor(I2C& i2c_,int addr); + T_motor& operator=(float fval); + bool run(char mode,char speed); + bool stop(); + bool free(); +}; +#endif \ No newline at end of file