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
Fork of Roboshark_V9 by
Diff: Fahren.cpp
- Revision:
- 15:8e8b23d4abb4
- Parent:
- 14:feafcee53fed
--- a/Fahren.cpp Mon May 14 22:11:47 2018 +0000 +++ b/Fahren.cpp Tue May 15 21:50:26 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 = 120.0f; //120 -SpeedL = 120.0f; //120 +SpeedR = 90.0f; //120 +SpeedL = 90.0f; //120 disF = 0.0f; //ticker.attach(callback(this, &Fahren::reset), PERIOD); } @@ -50,13 +50,13 @@ reglerEinL = 1; while(1){ - 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; + float diff = (iRSensor.readR() - iRSensor.readL())*0.95f; //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)); - + printf("diff = %f\n",diff); wait(0.02); //0.02 // printf("Encoderrechts %d \n\r", counterRight.read()); //Debugging Zweck (Putty benutzen!)