AF_TB6612FNG is a library of TB6612FNG.

Example

include the mbed library with this snippet

#include "mbed.h"
#include "AF_TB6612FNG.h"

AF_TB6612FNG tb6612fng(p21, p20, p19, p22, p18, p17, p12);

int main() {
    float speed = 0.6;
    tb6612fng.forward(speed);
}
Revision:
0:98dcc458e267
Child:
2:d6cb78f523b0
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/AF_TB6612FNG.h	Mon Jun 04 00:23:18 2018 +0000
@@ -0,0 +1,27 @@
+#ifndef MBED_AF_TB6612FNG_H
+#define MBED_AF_TB6612FNG_H
+
+#include "mbed.h"
+#include "Moter.h"
+
+class AF_TB6612FNG
+{
+public:
+    AF_TB6612FNG(PinName pwma, PinName ain1, PinName ain2, PinName pwmb, PinName bin1, PinName bin2, PinName standby);
+    void stop();
+    void forward(float speed);
+    void back(float speed);
+    void left(float speed);
+    void right(float speed);
+    bool isForward();
+    void setISForward(bool isForward);
+
+private:
+    Moter _motorL;
+    Moter _motorR;
+    DigitalOut _standby;
+
+    bool _isForward;
+};
+
+#endif