Tobis Programm forked to not destroy your golden files

Dependencies:   mbed

Fork of Robocode by PES 2 - Gruppe 1

Revision:
99:78d87027c85b
Parent:
98:07a8a858e7cd
Child:
113:c7afe49752b9
--- a/source/IRSensor.cpp	Wed May 03 06:59:34 2017 +0000
+++ b/source/IRSensor.cpp	Wed May 03 08:47:21 2017 +0000
@@ -66,6 +66,11 @@
     } else {
         voltage = distance->read();
     }
+    
+    if (voltage < 0.1f) voltage = 0.1f;
+    if (voltage > 1.0f) voltage = 1.0f;
+        
+    
     mean = 0.8f*mean + 0.2f*voltage;
 }
 
@@ -100,6 +105,11 @@
         default:
             break;
     }
+    /*
+    if (d > 1.0f || d < 0) {
+        d = 0.99f;
+    }*/
+        
     return d;
 }