Stepper motor control class library
Dependents: StepperMotor_HelloWorld
Components pages
Components pages are available for bipolar
and unipolar
motor libraries
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; }