Michael Marzano / Mbed 2 deprecated Linear_Stepper_Motor_Nema17

Dependencies:   mbed

Revision:
1:757a52db1604
Parent:
0:54c5be5f26f4
Child:
3:2138b69ee3bd
--- a/lin_step_mtr.h	Sun Apr 19 22:16:24 2020 +0000
+++ b/lin_step_mtr.h	Mon Apr 20 02:52:30 2020 +0000
@@ -124,7 +124,7 @@
     /** Initializes the rotate thread and sets parameters before you begin
      *
      */
-    void init(double rpm = DEFAULT_SPEED, Direction d=CW);
+    void init(double rpm=DEFAULT_SPEED, Direction d=CW);
     
     /** Ends possibility of motion
      *
@@ -134,7 +134,7 @@
     /** Rotates the motor for a set number of rotations
      *
      */
-    double rotate(float num_rev);
+    //double rotate(float num_rev);
     
     /** Starts continuous motion in the current direction
      *
@@ -181,6 +181,8 @@
         Step_Num operator++();
         //decrement step post incr operator
         Step_Num operator--();
+        //Sets step
+        void operator=(Step_Num s);
         //getter for cur_step
         Step_Num get_cur_step();
         
@@ -198,6 +200,7 @@
      *  lives in it's own thread
      */
     void rotate();
+    static void rotate_help(void const *args);
     
     /** Spins up the motor by stepping up from min speed to current speed
      *
@@ -219,7 +222,7 @@
     Step cur_step;                 // Current Step, i.e. which one was just written to the motor 
     volatile Direction dir;                 // The direction for the motor to run
     
-    Thread rotate_th;                       // Thread to run the rotate function
+    Thread *rotate_th;                       // Thread to run the rotate function
     volatile bool stop_mtr;                 // Flag for if motor should be off;
     volatile bool terminate;                // Flag for if the rotate function should stop executing