Stepper motor control class library

Dependents:   StepperMotor_HelloWorld

Components pages

Components pages are available for bipolar and unipolar motor libraries

A bipolar stepper motor driving pulse generator

A unipolar stepper motor driving pulse generator

Revision:
2:f14b5e7276b0
Parent:
1:dc6cf8f8bcb7
--- a/StepperMotor.cpp	Fri Nov 26 15:32:25 2010 +0000
+++ b/StepperMotor.cpp	Wed Sep 13 04:30:35 2017 +0000
@@ -2,12 +2,15 @@
  *  
  *  @class   StepperMotor
  *  @author  Tedd OKANO
- *  @version 0.51(27-Nov-2010)
+ *  @version 0.6 (13-Sep-2017)
  *  
  *  Copyright: 2010 Tedd OKANO, Tsukimidai Communications Syndicate - Crawl Design
  *  The library that controls stepper motor via motor driver chip: TA7774
  *  The TA7774 is a driver for a bipolar stepper motor. 
  *  With this library, mbed will generate 2 phase pulses to operate the motor. 
+ *  
+ *  version 0.51  (27-Nov-2010)
+ *  version 0.6   (13-Sep-2017) //  fixed to keep last position while power-control disabled
  */
  
 #include "mbed.h"
@@ -170,7 +173,9 @@
     diff    = target_pos - current_pos;
 
     if ( !diff ) {
-        pwr_out = power_ctrl ? 0 : 1;
+        if ( power_ctrl )
+            pwr_out = 0;
+            
         return;
     }