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.
Dependencies: mbed mbed-rtos TextLCD
Diff: STEPPER_MOTOR.cpp
- Revision:
- 14:63998be3d43c
- Parent:
- 12:d9c133b360b0
- Child:
- 16:9f98ec0ededb
--- a/STEPPER_MOTOR.cpp Mon Feb 11 14:18:58 2019 +0000 +++ b/STEPPER_MOTOR.cpp Mon Feb 11 16:58:07 2019 +0000 @@ -19,10 +19,10 @@ //int timeofturn=correctinfactor*speed; int mystep=0; - printf("START!!! step value is=%d\n\r",mystep); + //printf("START!!! step value is=%d\n\r",mystep); for(int x =0 ; x <= Steps; x++) { - printf("FOR LOOP! step value is=%d %d\n\r",mystep,x); // debugging feedback + //printf("FOR LOOP! step value is=%d %d\n\r",mystep,x); // debugging feedback // phase pulse order this->pin1 = 0; this->pin2 = 1; @@ -31,7 +31,7 @@ mystep=1; wait_us(1000); - printf("FOR LOOP! step value is=%d %d\n\r",mystep,x); + //printf("FOR LOOP! step value is=%d %d\n\r",mystep,x); this->pin1 = 0; this->pin2 = 1; this->pin3 = 1; @@ -39,7 +39,7 @@ mystep=2; wait_us(1000); - printf("FOR LOOP! step value is=%d %d\n\r",mystep,x); + //printf("FOR LOOP! step value is=%d %d\n\r",mystep,x); this->pin1 = 1; this->pin2 = 0; this->pin3 = 1; @@ -47,13 +47,13 @@ mystep=3; wait_us(1000); - printf("FOR LOOP! step value is=%d %d\n\r",mystep,x); + // printf("FOR LOOP! step value is=%d %d\n\r",mystep,x); this->pin1 = 1; this->pin2 = 0; this->pin3 = 0; this->pin4 = 1; mystep=4; - wait_us(1000);; + wait_us(1000); /* printf("FOR LOOP! step value is=%d %d\n\r",mystep,x); this->pin1 = 0; @@ -91,6 +91,10 @@ mystep=0; wait_ms(0.6);*/ } + this->pin1 = 0; + this->pin2 = 0; + this->pin3 = 0; + this->pin4 = 0; } /*