PWM with L298

Dependencies:   mbed TextLCD1

Fork of L298 by Hernán Maya

Files at this revision

API Documentation at this revision

Comitter:
juanitoinig84
Date:
Thu Jul 07 04:45:32 2016 +0000
Parent:
4:28c613b8345b
Commit message:
Second versi?n

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 28c613b8345b -r 18d7cd116331 main.cpp
--- a/main.cpp	Mon Jul 04 19:39:53 2016 +0000
+++ b/main.cpp	Thu Jul 07 04:45:32 2016 +0000
@@ -32,8 +32,11 @@
 int main()
 {
     //int frequency = 0;
-    ena.period_us(250);
-    enb.period_us(250);
+   // ena.period_us(250);
+    //enb.period_us(250);
+    
+    ena.period(1.0/5000.0);// 4Khz period
+    enb.period(1.0/5000.0);// 4Khz period
     pc.baud(115200);
     pc.printf("Peristaltic pumps FRDM-K64F board.\n");
     while (true) {
@@ -41,10 +44,10 @@
        
         stop1();                     //Stop motor
         wait(2.0f);
-        turnLeft1();                // Gira en sentido 1
+        turnRight1();                // Gira en sentido 1
         ena.write(0.50f);           //Velocidad 50%
         wait(2.0f);
-       turnRight1();                // Gira en sentido 2 
+        turnLeft1();                // Gira en sentido 2 
         ena.write(1.00f);           // Velocidad 100%
         wait(2.0f);