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: SensoryTest
Fork of btbee by
Revision 15:cc5b8a858c6e, committed 2014-05-21
- Comitter:
- mmpeter
- Date:
- Wed May 21 12:20:43 2014 +0000
- Parent:
- 14:7ddbd9f475ad
- Child:
- 16:2b437630e29e
- Commit message:
- k=-0.7, speed=0.5, correction for jumpy turns
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Wed May 21 12:06:54 2014 +0000
+++ b/main.cpp Wed May 21 12:20:43 2014 +0000
@@ -6,13 +6,13 @@
int main() {
- float speed = 0.25;
+ float speed = 0.5;
float correction;
- float k = -0.3;
+ float k = -0.7;
thinggy.locate(0,1);
- thinggy.printf("Line Flw");
+ thinggy.printf("HellzYa");
wait(1.0);
@@ -26,7 +26,10 @@
//speed limiting for right motor
if(speed + correction > 1){
- thinggy.right_motor(1);
+ thinggy.right_motor(0.6);
+ }
+ else if(speed + correction <= 0){
+ thinggy.right_motor(0.1);
}
else{
thinggy.right_motor(speed+correction);
@@ -34,7 +37,10 @@
//speed limiting for left motor
if(speed - correction > 1){
- thinggy.left_motor(1);
+ thinggy.left_motor(0.6);
+ }
+ else if(speed - correction <= 0){
+ thinggy.left_motor(0.1);
}
else{
thinggy.left_motor(speed-correction);
