library for the motor driver

Dependents:   4180_final_project

Fork of libTCS34725 by Michael Wilkens

Files at this revision

API Documentation at this revision

Comitter:
mwilkens241
Date:
Tue Apr 18 19:53:13 2017 +0000
Parent:
6:560b232837cf
Child:
8:fe6530d23d58
Commit message:
fixed standby error

Changed in this revision

TB6612FNG.cpp Show annotated file Show diff for this revision Revisions of this file
TB6612FNG.h Show annotated file Show diff for this revision Revisions of this file
--- a/TB6612FNG.cpp	Fri Mar 31 15:50:00 2017 +0000
+++ b/TB6612FNG.cpp	Tue Apr 18 19:53:13 2017 +0000
@@ -24,6 +24,12 @@
 }
 
 void TB6612FNG::stop(){
+    *dir1 = 0;
+    *dir2 = 0;
+    *pwm = 1;
+}
+
+void TB6612FNG::standby(){
     on = false;
     *dir1 = 0;
     *dir2 = 0;
--- a/TB6612FNG.h	Fri Mar 31 15:50:00 2017 +0000
+++ b/TB6612FNG.h	Tue Apr 18 19:53:13 2017 +0000
@@ -56,9 +56,13 @@
         */
         void start();
         
+        /** Stops the motor from moving
+        */
+        void stop();
+        
         /** Disables the motor, puts it into standby
         */
-        void stop();
+        void standby();
         
         /** Sets the motor to move forward at a given speed (as a percent [0,1])
         * @param speed Speed of the motor as a percent [0,1]