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.
Dependencies: mbed
Diff: Robot.h
- Revision:
- 13:521d6c6e7042
- Parent:
- 12:11d203351eb0
--- a/Robot.h Mon Apr 29 00:57:32 2019 +0000
+++ b/Robot.h Mon Apr 29 09:40:30 2019 +0000
@@ -173,13 +173,15 @@
sensorNumber = 0;
if (endOfLineDetection < 5)
{
- AF = 0.425f;
+ AF = 0.5f;
adjustRbtAngularVelocity(lineVoltages[lvIndex%numberOfSamples]);
lvIndex++;
}
else
{
- stopMovement();
+ stopMovement();
+ rightWheel->resetPID();
+ leftWheel->resetPID();
}
endOfLineDetection = 0;
}
@@ -187,10 +189,13 @@
void turn180()
{
+ stopMovement();
+ rightWheel->resetPID();
+ leftWheel->resetPID();
updater.detach();
rightWheel->adjustAngularVelocity(rightWheel->returnMaxAngularVel()*0.3f);
leftWheel->adjustAngularVelocity(rightWheel->returnMaxAngularVel()*-0.3f);
- timeToStop.attach(callback(this, &Robot::reAttach),1.1f);
+ timeToStop.attach(callback(this, &Robot::reAttach),1.0f);
state = 'S';
}