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 11:6c56d8ca6e99, committed 2015-11-29
- Comitter:
- Xiaofei
- Date:
- Sun Nov 29 00:15:41 2015 +0000
- Parent:
- 10:6e32b53f04c3
- Commit message:
- C
Changed in this revision
| Command.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/Command.cpp Sun Nov 29 00:02:54 2015 +0000
+++ b/Command.cpp Sun Nov 29 00:15:41 2015 +0000
@@ -15,6 +15,8 @@
Command::Command():_SPEED(0),_IS_NEGATIVE(0)
{}
+#define SENSITIVITY 0.9
+
void Command::setSpeed(const std::int8_t& sp, const std::int8_t& is_negative)
{
_STBY = 1;
@@ -33,12 +35,12 @@
if(_IS_NEGATIVE)
{
_RIGHT_WHEEL.speed(-_SPEED);
- _LEFT_WHEEL.speed(-_SPEED*0.65);
+ _LEFT_WHEEL.speed(-_SPEED*SENSITIVITY);
}
else
{
_RIGHT_WHEEL.speed(_SPEED);
- _LEFT_WHEEL.speed(_SPEED*0.65);
+ _LEFT_WHEEL.speed(_SPEED*SENSITIVITY);
}
}
@@ -47,12 +49,12 @@
_STBY = 1;
if(_IS_NEGATIVE)
{
- _RIGHT_WHEEL.speed(-_SPEED*0.65);
+ _RIGHT_WHEEL.speed(-_SPEED*SENSITIVITY);
_LEFT_WHEEL.speed(-_SPEED);
}
else
{
- _RIGHT_WHEEL.speed(_SPEED*0.65);
+ _RIGHT_WHEEL.speed(_SPEED*SENSITIVITY);
_LEFT_WHEEL.speed(_SPEED);
}
}