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
Diff: T_motor.cpp
- Revision:
- 2:f82a7c0b697f
- Parent:
- 1:5bd161b83ce0
- Child:
- 3:a3be8ae9fed1
diff -r 5bd161b83ce0 -r f82a7c0b697f T_motor.cpp
--- a/T_motor.cpp Sun Aug 13 03:48:22 2017 +0000
+++ b/T_motor.cpp Mon Aug 21 00:56:29 2017 +0000
@@ -27,6 +27,7 @@
T_motor& T_motor::operator=(float fval)// -1 <= fval <= 1
{
+ fval = sqrt(fval);
if(fabs(fval) < 0.1f)free();
else {
if(fval < 0) run(1,char(-1*fval*255));
@@ -37,6 +38,7 @@
void T_motor::control(float fval)//copy from operator
{
+ fval = sqrt(fval);
if(fabs(fval) < 0.1f)free();
else {
if(fval < 0) run(1,char(-1*fval*255));
