Satoshi Iyobe / TB6612FNG

Dependents:   measure_1_BBB measure_1_CCC measure_1_DDD

Revision:
0:085abb7f6992
Child:
1:4c4f2d25dc05
diff -r 000000000000 -r 085abb7f6992 TB6612FNG.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TB6612FNG.cpp	Fri May 07 03:27:26 2021 +0000
@@ -0,0 +1,38 @@
+#include "mbed.h"
+#include "TB6612FNG.h"
+
+TB6612FNG::TB6612FNG(PinName IN1, PinName IN2, PinName STBY, PinName PWM):
+    _IN1(IN1), _IN2(IN2), _STBY(STBY), _PWM(PWM)
+{
+    _PWM = 0;
+}
+
+void TB6612FNG::STBY(bool f)
+{
+    _STBY = f;
+}
+
+void TB6612FNG::SetW(float W)
+{
+    _PWM = W;
+}
+
+void TB6612FNG::Forward()
+{
+    _IN1 = 1;
+    _IN2 = 0;
+}
+
+void TB6612FNG::Stop()
+{
+    _IN1 = 0;
+    _IN2 = 0;
+}
+
+/*
+void TB6612FNG::Reverse(byte rpm);
+void TB6612FNG::Stop(byte rpm);
+void TB6612FNG::Brake(byte rpm);
+*/
+
+