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 T_motor by
Revision 5:0e69f06b24ff, committed 2017-09-02
- Comitter:
- fujikenac
- Date:
- Sat Sep 02 07:15:47 2017 +0000
- Parent:
- 4:8c674d9893ad
- Child:
- 6:dc3db7df2a4b
- Commit message:
- remove sqrt
Changed in this revision
| T_motor.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/T_motor.cpp Fri Aug 25 01:56:12 2017 +0000
+++ b/T_motor.cpp Sat Sep 02 07:15:47 2017 +0000
@@ -29,8 +29,8 @@
{
if(fabs(fval) < 0.1f)free();
else {
- if(fval < 0) run(1,char(sqrt(-1*fval)*255));
- else if(fval > 0) run(0,char(sqrt(fval)*255));
+ if(fval < 0) run(1,char(-1*fval*255));
+ else if(fval > 0) run(0,char(fval*255));
}
return *this;
}
@@ -39,8 +39,8 @@
{
if(fabs(fval) < 0.1f)free();
else {
- if(fval < 0) run(1,char(sqrt(-1*fval)*255));
- else if(fval > 0) run(0,char(sqrt(fval)*255));
+ if(fval < 0) run(1,char(-1*fval*255));
+ else if(fval > 0) run(0,char(fval*255));
}
}
