Tobis Programm forked to not destroy your golden files

Dependencies:   mbed

Fork of Robocode by PES 2 - Gruppe 1

Revision:
88:b89cace9329b
Parent:
81:956f65714207
Child:
89:7f9d6e641a01
--- a/source/Robot.cpp	Mon May 01 12:55:11 2017 +0000
+++ b/source/Robot.cpp	Mon May 01 13:38:00 2017 +0000
@@ -42,6 +42,7 @@
 DigitalIn user(USER_BUTTON);
 
 //Motor stuff
+Ticker t5;
 EncoderCounter counterLeft(PB_6, PB_7);
 EncoderCounter counterRight(PA_6, PC_7);
 
@@ -125,11 +126,11 @@
     actualSpeedLeft = 0.0f;
     actualSpeedRight = 0.0f;
 
-    Ticker t1;
-    t1.attach( &speedCtrl, PERIOD);
+
+    t5.attach( &speedCtrl, PERIOD);
 
-    //desiredSpeedLeft = 50.0f+correction_value; //50 RPM
-    //desiredSpeedRight = -50.0f; //50 RPM
+    desiredSpeedLeft = 50.0f+correction_value; //50 RPM
+    desiredSpeedRight = -50.0f; //50 RPM
     enableMotorDriver = 1;
 }
 
@@ -137,6 +138,7 @@
 {
     desiredSpeedLeft = left+correction_value; //50 RPM
     desiredSpeedRight = -right; //50 RPM
+    printf("real speed set as: %f\r\n",desiredSpeedLeft);
 }
 
 float get_speed_left()
@@ -152,6 +154,7 @@
 
 void speedCtrl()
 {
+    printf("speed Ctrl called\r\n");
     // Berechnen die effektiven Drehzahlen der Motoren in [rpm]
     short valueCounterLeft = counterLeft.read();
     short valueCounterRight = counterRight.read();