Roboshark / Mbed 2 deprecated Roboshark_V10

Dependencies:   mbed

Fork of Roboshark_V9 by Roboshark

Files at this revision

API Documentation at this revision

Comitter:
ahlervin
Date:
Tue May 08 09:22:32 2018 +0000
Parent:
10:fb2195d0de0f
Child:
12:cd07a80f0a9a
Commit message:
Kommt ins Ziel

Changed in this revision

Fahren.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/Fahren.cpp	Tue May 08 09:07:37 2018 +0000
+++ b/Fahren.cpp	Tue May 08 09:22:32 2018 +0000
@@ -17,8 +17,8 @@
 //Konstruktor
 Fahren::Fahren(Controller& controller, EncoderCounter& counterLeft, EncoderCounter& counterRight, IRSensor& iRSensor):
     controller(controller), counterLeft(counterLeft), counterRight(counterRight), iRSensor (iRSensor){
-SpeedR = 80.0f;
-SpeedL = 80.0f;
+SpeedR = 90.0f;
+SpeedL = 90.0f;
 disF = 0.0f;
 //ticker.attach(callback(this, &Fahren::reset), PERIOD);
 }
@@ -50,9 +50,9 @@
     reglerEinL = 1;
     
     while(1){
-    float diff = (iRSensor.readR() - iRSensor.readL())*0.9f;            //Regler
-    if(iRSensor.readR()>60.0f) diff=0;
-    if(iRSensor.readL()>60.0f) diff=0;
+    float diff = (iRSensor.readR() - iRSensor.readL())*0.95f;            //Regler
+    if(iRSensor.readR()>80.0f) diff=0;
+    if(iRSensor.readL()>80.0f) diff=0;
     //printf("diff =%f \n",diff);
     controller.setDesiredSpeedRight(SpeedR+diff);
     controller.setDesiredSpeedLeft(-(SpeedL-diff));