a

Revision:
0:810f315ba3dc
Child:
1:051a7ecff13e
Child:
2:ad4e7374e5c1
diff -r 000000000000 -r 810f315ba3dc TB6612.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TB6612.h	Tue Oct 23 15:24:30 2012 +0000
@@ -0,0 +1,35 @@
+/**
+ * Motor Driver TB6612 Control Library
+ *
+ * -- TB6612 is a device of the rohm. 
+ *
+ * Copyright (C) 2012 Junichi Katsu (JKSOFT) 
+ */
+
+#ifndef MBED_TB6612_H
+#define MBED_TB6612_H
+
+#include "mbed.h"
+
+class TB6612 {
+public:
+    TB6612(PinName pwm, PinName fwd, PinName rev);
+    void speed(float speed);
+    void move(float speed , float time);
+    void operator= ( float value )
+    {
+        speed(value);
+    }
+    
+protected:
+    PwmOut _pwm;
+    DigitalOut _fwd;
+    DigitalOut _rev;
+    Timeout timer;
+    float    bspeed;
+    bool     timer_flag;
+    void timeout();
+
+};
+
+#endif