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 4:8c674d9893ad, committed 2017-08-25
- Comitter:
- fujikenac
- Date:
- Fri Aug 25 01:56:12 2017 +0000
- Parent:
- 3:a3be8ae9fed1
- Child:
- 5:0e69f06b24ff
- Commit message:
- fix sqrt crazy
Changed in this revision
| T_motor.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/T_motor.cpp Mon Aug 21 04:31:39 2017 +0000
+++ b/T_motor.cpp Fri Aug 25 01:56:12 2017 +0000
@@ -29,7 +29,7 @@
{
if(fabs(fval) < 0.1f)free();
else {
- if(fval < 0) run(1,char(-1*sqrt(fval)*255));
+ if(fval < 0) run(1,char(sqrt(-1*fval)*255));
else if(fval > 0) run(0,char(sqrt(fval)*255));
}
return *this;
@@ -39,7 +39,7 @@
{
if(fabs(fval) < 0.1f)free();
else {
- if(fval < 0) run(1,char(-1*sqrt(fval)*255));
+ if(fval < 0) run(1,char(sqrt(-1*fval)*255));
else if(fval > 0) run(0,char(sqrt(fval)*255));
}
}
