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.
Diff: motor.cpp
- Revision:
- 6:366ec55e64fe
- Parent:
- 5:15d0276d7e21
- Child:
- 7:42c478f9a1fe
--- a/motor.cpp Tue Jun 25 11:01:39 2019 +0000
+++ b/motor.cpp Wed Jul 10 04:08:29 2019 +0000
@@ -185,6 +185,11 @@
{
return (CurrentPosition*3.14159265359*0.043/CntPerRev);
}
+float MotorCtl::CalculateVelocity()
+{
+ return (DeltaCnt*1000.0)*3.14159265359*0.043/(float)(DeltaT*CntPerRev)
+}
+