Michael Marzano / Mbed 2 deprecated Linear_Stepper_Motor_Nema17

Dependencies:   mbed

Revision:
5:955bbc08ee78
Parent:
4:1dc350268172
Child:
6:0c5418e05145
--- a/lin_step_mtr.cpp	Mon Apr 27 00:33:53 2020 +0000
+++ b/lin_step_mtr.cpp	Mon Apr 27 01:01:59 2020 +0000
@@ -1,7 +1,7 @@
 // Code for the lin_step_mtr driver
 
 #include "lin_step_mtr.h"
-//#include "debug.h"
+#include "debug.h"
 
 //Construtor
 LinStepMtr::LinStepMtr(PinName A_f, PinName A_r, PinName B_f, PinName B_r, int m_rpm=MAX_RPM)
@@ -74,6 +74,14 @@
     spin_up();   
 }
 
+void LinStepMtr::start(Direction d) {
+    if(dir != d){
+        dir = d;
+    }
+    stop_mtr = false;
+    spin_up();   
+}
+
 void LinStepMtr::stop() {
     int s = spin_down();
     stop_mtr = true;   
@@ -109,7 +117,7 @@
 
 void LinStepMtr::rotate()
 {
-//    pc.printf("Called rotate()\n");
+    pc.printf("Called rotate()\n");
  /*
     while(1) {