![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
fdas
Diff: Motor3_L298N/Moter3_L298N.h
- Revision:
- 0:13ba01a70b4a
diff -r 000000000000 -r 13ba01a70b4a Motor3_L298N/Moter3_L298N.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Motor3_L298N/Moter3_L298N.h Sun May 06 06:01:45 2018 +0000 @@ -0,0 +1,21 @@ +#ifndef MOTOR3_L298N_H_ +#define MOTOR3_L298N_H_ +#include "mbed.h" + +DigitalOut mydia1(PinName a1,int b1); +DigitalOut mydia2(PinName a2,int b2); +PwmOut mypwa(PinName pa); + + +class Motor_3{ +public: + Motor_3(PinName dia1,PinName dia2,PinName pwa); + void mv(float speed); //speed取值范围0-20浮点数 + void stop(); +protected: + float _paspeed; + PinName _dia1; + PinName _dia2; + PinName _pwa; +}; +#endif