PES 2 - Gruppe 1 / Mbed 2 deprecated Robocode_Random

Dependencies:   mbed

Fork of Robocode by PES 2 - Gruppe 1

Revision:
22:c8e187b9d949
Parent:
21:cb40c0533bc2
Child:
23:4ddc4216f335
--- a/source/main.cpp	Thu Mar 02 20:07:41 2017 +0000
+++ b/source/main.cpp	Fri Mar 03 20:44:01 2017 +0000
@@ -14,6 +14,11 @@
 //static double time_counter = 0.0f;
 //static double deltatime = 0.0f;
 
+InterruptIn EncoderLeftA(PB_6);
+InterruptIn EncoderLeftB(PB_7);
+InterruptIn EncoderRightA(PA_6);
+InterruptIn EncoderRightB(PC_7);
+
 //DigitalOut led(LED1); // Board LED
 
 //Perophery for distance sensors
@@ -30,17 +35,25 @@
 
 
 
-
 static double time_counter = 0.0f;
 static double timer0 = 0.0f;
 bool status = 0;
 
 int main()
 {
+    __enable_irq();     
+
+    EncoderLeftA.rise(&highPulseDetectedL);
+    EncoderLeftB.rise(&highPulseDetectedL);
+    EncoderRightA.rise(&highPulseDetectedR);
+    EncoderRightB.rise(&highPulseDetectedR);
+
     move_init();
-    while(1){
+    while(1){   
     sync_movement(false,true);
     }
+    
+    
 /*    while(1){
         if(status == 1){
             led = 0;
@@ -56,3 +69,4 @@
 }
 
 
+