PES 2 - Gruppe 1 / Mbed 2 deprecated Robocode_Random

Dependencies:   mbed

Fork of Robocode by PES 2 - Gruppe 1

Revision:
24:6c2fec64f890
Parent:
23:4ddc4216f335
Child:
25:08ee4525155b
--- a/source/main.cpp	Sat Mar 04 13:57:41 2017 +0000
+++ b/source/main.cpp	Sat Mar 04 15:04:14 2017 +0000
@@ -14,11 +14,13 @@
 //static double time_counter = 0.0f;
 //static double deltatime = 0.0f;
 
-InterruptIn EncoderLeftA(PB_6);
-InterruptIn EncoderLeftB(PB_7);
+//InterruptIn EncoderLeftA(PB_6);
+//InterruptIn EncoderLeftB(PB_7);
 InterruptIn EncoderRightA(PA_6);
 InterruptIn EncoderRightB(PC_7);
 
+DigitalIn encoder(PB_6);
+
 //DigitalOut led(LED1); // Board LED
 
 //Perophery for distance sensors
@@ -31,7 +33,7 @@
 
 //indicator leds arround robot
 DigitalOut leds[] = { PC_8, PC_6, PB_12, PA_7, PC_0, PC_9 };
-
+DigitalOut led(LED1); // Board LED
 
 
 
@@ -41,31 +43,36 @@
 
 int main()
 {
-    __enable_irq();     
+    __enable_irq();
 
-    EncoderLeftA.rise(&highPulseDetectedL);
-    EncoderLeftB.rise(&highPulseDetectedL);
+    // EncoderLeftA.rise(&highPulseDetectedL);
+    //EncoderLeftB.rise(&highPulseDetectedL);
     //EncoderRightA.rise(&highPulseDetectedR); // wird erkannt
     //EncoderRightB.rise(&highPulseDetectedR); // wird erkannt
 
     move_init();
-    while(1){   
-    sync_movement(false,true);
-    }
-    
-    
-/*    while(1){
-        if(status == 1){
+    while(1) {
+        //sync_movement(false,true);
+        if(encoder) {
+            led = 1;
+        } else {
             led = 0;
-            wait(0.5);
-            status = 0;
-        }else{
-            led = 1;
-            timer0 = 0.0f;
-            pathfinding();
-            status = 1;
         }
-    }*/
+    }
+
+
+    /*    while(1){
+            if(status == 1){
+                led = 0;
+                wait(0.5);
+                status = 0;
+            }else{
+                led = 1;
+                timer0 = 0.0f;
+                pathfinding();
+                status = 1;
+            }
+        }*/
 }