lib de ugokasu
Revision 0:25ffb1df8a87, committed 2021-03-04
- Comitter:
- THtakahiro702286
- Date:
- Thu Mar 04 09:48:23 2021 +0000
- Commit message:
- lib de ugokasu
Changed in this revision
lib.cpp | Show annotated file Show diff for this revision Revisions of this file |
lib.h | Show annotated file Show diff for this revision Revisions of this file |
diff -r 000000000000 -r 25ffb1df8a87 lib.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib.cpp Thu Mar 04 09:48:23 2021 +0000 @@ -0,0 +1,14 @@ +#include "lib.h" + +Lib::Lib() +{ + md[0] = new KohiMD(PA_15); + md[1] = new KohiMD(PA_6); + md[2] = new KohiMD(PA_7); + md[3] = new KohiMD(PB_6); +} + +void Lib::go(double pwm) +{ + for(int i=0; i < 4; i++) md[i]->setSpeed(pwm); +} \ No newline at end of file
diff -r 000000000000 -r 25ffb1df8a87 lib.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib.h Thu Mar 04 09:48:23 2021 +0000 @@ -0,0 +1,15 @@ +#ifndef LIB_H +#define LIB_H + +#include "kohiMD.h" +#include "mbed.h" + +class Lib +{ +public: + Lib(); + void go(double pwm); +private: + KohiMD *md[4]; +}; +#endif \ No newline at end of file