Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: StepperMotor_HelloWorld
Revision 2:f14b5e7276b0, committed 2017-09-13
- Comitter:
- okano
- Date:
- Wed Sep 13 04:30:35 2017 +0000
- Parent:
- 1:dc6cf8f8bcb7
- Commit message:
- version 0.6: fixed to keep last position while power-control disabled
Changed in this revision
| StepperMotor.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r dc6cf8f8bcb7 -r f14b5e7276b0 StepperMotor.cpp
--- 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;
}