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.
Fork of MotorThrottle by
Revision 2:1de1be9f0ab7, committed 2017-10-30
- Comitter:
- jordymorsinkhof
- Date:
- Mon Oct 30 15:51:11 2017 +0000
- Parent:
- 1:f808e6189b2b
- Commit message:
- Changed nothing;
Changed in this revision
| Motor.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/Motor.cpp Mon Oct 30 13:52:12 2017 +0000
+++ b/Motor.cpp Mon Oct 30 15:51:11 2017 +0000
@@ -9,6 +9,8 @@
{
SetPID(1,0,0);
_GearRatio=1;
+ MotorThrottle=0;
+ MotorDirection=0;
}
void Motor::GotoPos(float Rad){
@@ -47,6 +49,7 @@
MotorDirection=0;
MotorThrottle=0.0f;
encoder.reset((int)4200.0f*_GearRatio*(HomingPos/2.0f/3.1415));
+ Stop();
}
void Motor::SetPID(float P,float Ti,float Td){
@@ -62,7 +65,7 @@
}
void Motor::SetOutputLimits(float Omin, float Omax){
- controller.setInputLimits(Omin,Omax);
+ controller.setOutputLimits(Omin,Omax);
}
void Motor::Stop(){
