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.
Revision 7:42c478f9a1fe, committed 2019-07-10
- Comitter:
- kangmingyo
- Date:
- Wed Jul 10 04:30:47 2019 +0000
- Parent:
- 6:366ec55e64fe
- Commit message:
- update_velocity v2
Changed in this revision
| motor.cpp | Show annotated file Show diff for this revision Revisions of this file |
| motor.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/motor.cpp Wed Jul 10 04:08:29 2019 +0000
+++ b/motor.cpp Wed Jul 10 04:30:47 2019 +0000
@@ -187,7 +187,7 @@
}
float MotorCtl::CalculateVelocity()
{
- return (DeltaCnt*1000.0)*3.14159265359*0.043/(float)(DeltaT*CntPerRev)
+ return getRPM()*3.14159265359*0.043/60;
}
--- a/motor.h Wed Jul 10 04:08:29 2019 +0000
+++ b/motor.h Wed Jul 10 04:30:47 2019 +0000
@@ -17,7 +17,7 @@
int getRPM();
float CalculateCumDis();
float CalculateRelaDis();
- float CalculateVelocity()
+ float CalculateVelocity();
int getTarget();
int getError();
float getKP();