![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Testing 1 blue pill
Dependencies: mbed mbed-rtos TextLCD
Diff: Stepper_Motor/STEPPER_MOTOR.cpp
- Revision:
- 25:9751619fa030
- Parent:
- 23:07a368f2cdb1
- Child:
- 28:3193157ebb0c
--- a/Stepper_Motor/STEPPER_MOTOR.cpp Mon Feb 18 12:02:34 2019 +0000 +++ b/Stepper_Motor/STEPPER_MOTOR.cpp Mon Feb 18 22:04:54 2019 +0000 @@ -22,8 +22,16 @@ { return (_Steps_Done /50); } -void STEPPER_MOTOR::Rotate_Steps(int Steps) -{ +void STEPPER_MOTOR::Rotate_Steps(int Steps,int Function) +{ + if(Function == 2) + { + loop_wait_time = 1; + } + else if(Function == 3) + { + loop_wait_time = 2; + } Steps = Steps*50; //int correctionfactor; //int timeofturn=correctinfactor*speed; @@ -38,22 +46,22 @@ this->pin2 = 1; this->pin3 = 0; this->pin4 = 1; - Thread::wait(1); + Thread::wait(loop_wait_time); this->pin1 = 0; this->pin2 = 1; this->pin3 = 1; this->pin4 = 0; - Thread::wait(1); + Thread::wait(loop_wait_time); this->pin1 = 1; this->pin2 = 0; this->pin3 = 1; this->pin4 = 0; - Thread::wait(1); + Thread::wait(loop_wait_time); this->pin1 = 1; this->pin2 = 0; this->pin3 = 0; this->pin4 = 1; - Thread::wait(1); + Thread::wait(loop_wait_time); _Steps_Done = _Steps_Done +1; } else if (_Pause_Code == 1)