PROJ515 / Mbed 2 deprecated CoilingRigV9

Dependencies:   mbed mbed-rtos TextLCD

Revision:
16:9f98ec0ededb
Parent:
14:63998be3d43c
--- a/STEPPER_MOTOR.cpp	Mon Feb 11 20:43:39 2019 +0000
+++ b/STEPPER_MOTOR.cpp	Mon Feb 11 22:03:47 2019 +0000
@@ -9,7 +9,10 @@
 }
 
 STEPPER_MOTOR::~STEPPER_MOTOR(){}   //Destructor
-
+int STEPPER_MOTOR::Get_Steps_Done()
+{
+    return _Steps_Done;
+}
 void STEPPER_MOTOR::Rotate_Steps(int Steps)
 {
          #define STIME    1000
@@ -17,7 +20,7 @@
          Steps = Steps*50;
          //int correctionfactor;
          //int timeofturn=correctinfactor*speed;
-         
+         _Steps_Done = 0;
          int mystep=0;
          //printf("START!!! step value is=%d\n\r",mystep);
          for(int x =0 ; x <= Steps; x++)
@@ -54,6 +57,7 @@
                    this->pin4 = 1;
                    mystep=4;
                    wait_us(1000);
+                   _Steps_Done = _Steps_Done+1;
                    
  /*             printf("FOR LOOP! step value is=%d  %d\n\r",mystep,x);
                    this->pin1 = 0;