PES 2 - Gruppe 1 / Mbed 2 deprecated Robocode_Random

Dependencies:   mbed

Fork of Robocode by PES 2 - Gruppe 1

Revision:
136:b35f2d9b7402
Parent:
130:0d6c072b23ca
--- a/source/Safety.cpp	Tue May 16 15:24:23 2017 +0000
+++ b/source/Safety.cpp	Tue May 16 16:18:29 2017 +0000
@@ -3,36 +3,41 @@
 #include "mbed.h"
 #include "Safety.h"
 
-int safety(int state){
-    if(getDistanceIR(2) < 0.05f && state != 50) {   //state 50: grabbing state
+bool safety()
+{
+    float dist_ir = getDistanceIR(2);
+    if(getDistanceIR(2) < 0.1f) {   //state 50: grabbing state
         stop_move();
         stop_turn();
         printf("Stopped moving to prevent colission!\r\n");
-        return 11;
+        return 1;
     }
-    return state;
+    return 0;
 }
-    
-int emergency_shutdown(){
+
+int emergency_shutdown()
+{
     stop_move();
     stop_turn();
     disable_servos();
     disable_motors();
     return 0;
-    }
-    
-int colision_detected(){
-    
+}
+
+int colision_detected()
+{
+
     return 0;
-    }
-    
-int current_to_high(){
-    
+}
+
+int current_to_high()
+{
+
     return 0;
-    }
-    
-int overheating(){
-    
+}
+
+int overheating()
+{
+
     return 0;
-    }
-    
\ No newline at end of file
+}