lib de ugokasu

Files at this revision

API Documentation at this revision

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
--- /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
--- /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