Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: measure_1_BBB measure_1_CCC measure_1_DDD
Diff: TB6612FNG.cpp
- Revision:
- 0:085abb7f6992
- Child:
- 1:4c4f2d25dc05
--- /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);
+*/
+
+