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: motor_relay
Dependents: dog_V3_3_testmotor
Diff: motion_control.cpp
- Revision:
- 9:e3895130e56f
- Parent:
- 7:94518aee126b
--- a/motion_control.cpp Fri Jul 24 21:15:45 2015 +0000 +++ b/motion_control.cpp Mon Dec 07 09:15:37 2015 +0000 @@ -30,12 +30,16 @@ motor.StopMotor(); } } else { - motor.SetMotor(dirction); + motor.StopMotor(); + return 1; } return 0;//Normally } else if(_limit_down) { - motor.SetMotor(1); - // } + if(mode_limit == 0) { + motor.SetMotor(1); + } else { + motor.StopMotor(); + } return -1; } else { motor.SetMotor(dirction); @@ -119,7 +123,7 @@ sum += _position.read_u16(); } MIN_POSITION = sum/LOOP; - + SetMode(buff); }