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
Revision 9:e3895130e56f, committed 2015-12-07
- Comitter:
- soulx
- Date:
- Mon Dec 07 09:15:37 2015 +0000
- Parent:
- 7:94518aee126b
- Commit message:
- ??????????????????????
Changed in this revision
motion_control.cpp | Show annotated file Show diff for this revision Revisions of this file |
motion_control.h | Show annotated file Show diff for this revision Revisions of this file |
--- 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); }
--- a/motion_control.h Fri Jul 24 21:15:45 2015 +0000 +++ b/motion_control.h Mon Dec 07 09:15:37 2015 +0000 @@ -14,8 +14,8 @@ void calibration(); //limit - // open : '1' - // shot : '0' + // open : '0' + // shot : '1' int GetLimitUp(); int GetLimitDown();