PES2_R2D2.0 / Mbed 2 deprecated MicroMouse_MASTER_TWO

Dependencies:   mbed

Fork of Micromouse_alpha_copy_copy by PES2_R2D2.0

Files at this revision

API Documentation at this revision

Comitter:
ruesipat
Date:
Wed Apr 25 12:49:48 2018 +0000
Parent:
5:b8b1a979b0d5
Child:
7:5ef09519a6e9
Commit message:
25.04.2018_MIT Zielerkennung

Changed in this revision

Drive.cpp Show annotated file Show diff for this revision Revisions of this file
KontrastSensor.cpp Show annotated file Show diff for this revision Revisions of this file
Turn.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/Drive.cpp	Wed Apr 25 12:07:03 2018 +0000
+++ b/Drive.cpp	Wed Apr 25 12:49:48 2018 +0000
@@ -8,7 +8,7 @@
 using namespace std;
 
 const float Drive::FRONTDISTANCE = 62.0f; //Abstand Sensor zur VorderWand //DONT TOUCH
-const float Drive::DRIVINGSPEED = 100.0f;//Fahrgeschwindigkeit  Drehzahl in [rpm]
+const float Drive::DRIVINGSPEED = 50.0f;//Fahrgeschwindigkeit  Drehzahl in [rpm]
 const int Drive::DRIVINGCOUNTS = 1773;  //Entspricht Strecke von 20cm  //DONT TOUCH
 
 Drive::Drive(KontrastSensor& kontrastSensor, EncoderCounter& counterLeft, EncoderCounter& counterRight, Controller& controller, IRSensor& irSensor0, IRSensor& irSensor1, IRSensor& irSensor2, IRSensor& irSensor3):
@@ -65,7 +65,7 @@
 
     while(((countsRight <= countsRight0 + DRIVINGCOUNTS) || (countsLeft >= countsLeft0 - DRIVINGCOUNTS)) && (drive == 1) ) {
 
-        //kontrastSensor.check();
+        kontrastSensor.check();
         countsRight = counterRight.read();
         countsLeft = counterLeft.read();
         controller.setDesiredSpeedRight(DRIVINGSPEED - correction - slowdown); //Korrektur passt Geschwindigkeit an beiden Raedern an
@@ -135,7 +135,7 @@
 
     }//Ende Whileschleife Drive...
 
-    controller.setDesiredSpeedRight(0.0f);
-    controller.setDesiredSpeedLeft(0.0f);
+    controller.setDesiredSpeedRight(0.5f);  //0.0f
+    controller.setDesiredSpeedLeft(0.5f);   //0.0f
 
 }
--- a/KontrastSensor.cpp	Wed Apr 25 12:07:03 2018 +0000
+++ b/KontrastSensor.cpp	Wed Apr 25 12:49:48 2018 +0000
@@ -17,11 +17,11 @@
 void KontrastSensor::check()
 {
 
-    blackLine = 0;
+    
     float k = kontrast*3300; //sodass in Range bis 3300mV
-    //printf("%.0f\n", k);
+    printf("%.0f\n\r", k);
     
-    if(k >2500){
+    if(k >1300){
         blackLine = 1;
     }
     //else{//Auschalten im Betrieb (nur zur Kontrolle)
--- a/Turn.cpp	Wed Apr 25 12:07:03 2018 +0000
+++ b/Turn.cpp	Wed Apr 25 12:49:48 2018 +0000
@@ -39,8 +39,8 @@
         //printf("%d\n\r", countsRight);
         //printf("%d\n\r", countsLeft);
     }
-    controller.setDesiredSpeedRight(0.0f);
-    controller.setDesiredSpeedLeft(0.0f);
+    controller.setDesiredSpeedRight(0.5f);
+    controller.setDesiredSpeedLeft(0.5f);
     
     }else if (wallFront == 0){ //Nicht Drehen-> weiter Geradeaus
     
@@ -58,8 +58,8 @@
                 //printf("%d\n", countsRight);
                 //printf("%d\n", countsLeft);
             }
-            controller.setDesiredSpeedRight(0.0f);
-            controller.setDesiredSpeedLeft(0.0f);
+            controller.setDesiredSpeedRight(0.5f);
+            controller.setDesiredSpeedLeft(0.5f);
             
             
             }else{ //Alle Wege versperrt-> Wenden
@@ -74,7 +74,7 @@
                     //printf("%d\n", countsRight);
                     //printf("%d\n", countsLeft);
                 }
-                controller.setDesiredSpeedRight(0.0f);
-                controller.setDesiredSpeedLeft(0.0f);
+                controller.setDesiredSpeedRight(0.5f);  //0.0f
+                controller.setDesiredSpeedLeft(0.5f);   //0.0f
             }
 }