Beste Version
Dependencies: mbed
Fork of Roboshark_V8 by
Diff: Fahren.cpp
- Revision:
- 13:1687f97d4d82
- Parent:
- 12:cd07a80f0a9a
--- a/Fahren.cpp Tue May 08 10:48:05 2018 +0000 +++ b/Fahren.cpp Wed May 09 17:08:24 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 = 100.0f; -SpeedL = 100.0f; +SpeedR = 120.0f; //120 +SpeedL = 120.0f; //120 disF = 0.0f; //ticker.attach(callback(this, &Fahren::reset), PERIOD); } @@ -50,14 +50,14 @@ reglerEinL = 1; while(1){ - float diff = (iRSensor.readR() - iRSensor.readL())*0.85f; //Regler + float diff = (iRSensor.readR() - iRSensor.readL())*0.81f; //Regler 0.81 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)); - wait(0.05); + wait(0.02); //0.02 // printf("Encoderrechts %d \n\r", counterRight.read()); //Debugging Zweck (Putty benutzen!) // printf("Encoderlinks %d \n\r", counterLeft.read()); //Debugging Zweck (Putty benutzen!)