Keegan Hu
/
finalwarehouse
ddd
Fork of whouse by
Diff: Stepper_motor.cpp
- Revision:
- 4:d66b6f331b74
- Parent:
- 3:09f6061e6e5d
diff -r 09f6061e6e5d -r d66b6f331b74 Stepper_motor.cpp --- a/Stepper_motor.cpp Fri May 11 10:42:09 2018 +0000 +++ b/Stepper_motor.cpp Sun Jun 03 10:18:11 2018 +0000 @@ -85,15 +85,20 @@ */ void Stepper_motor::set() { + wait(0.01); + if(this->read() == 1) + { this -> Config(0,0);//停止运动 wait(0.01); this -> enable(); - this -> Config(-5,7); + this -> Config(-5,10); + } } + /** [Stepper_motor::Init 步进电机初始化] */ void Stepper_motor::Init() { this->Config(10,-1); - this->fall(this,&Stepper_motor::set); + this->rise(this,&Stepper_motor::set); } \ No newline at end of file