PES 2 - Gruppe 1 / Mbed 2 deprecated Robocode_Random

Dependencies:   mbed

Fork of Robocode by PES 2 - Gruppe 1

Revision:
31:51f52ffa4b51
Parent:
29:e7d0208bf2af
Child:
32:777976c4d733
--- a/source/main.cpp	Mon Mar 13 12:48:21 2017 +0000
+++ b/source/main.cpp	Tue Mar 14 16:24:15 2017 +0000
@@ -1,45 +1,89 @@
-/**
- *  Main File of Robocode
- *  Handels parallel processing and interupts
- *  Version 0.0.1
- *  PES2 Gruppe 1
- **/
+//#include "mbed.h"
+#include <stdio.h>
 
-#include "mbed.h"
-#include "pathfinding.h"
-#include "time.h"
-#include "IRsensor.h"
-#include "movement.h"
-#include "EncoderCounter.h"
 
 
-//Perophery for distance sensors
-AnalogIn distance(PB_1);
-DigitalOut enable(PC_1);
-DigitalOut bit0(PH_1);
-DigitalOut bit1(PC_2);
-DigitalOut bit2(PC_3);
-IRSensor sensors[6];
+int state = 0;
+
+int main() {
+    
+    init();
+
+    while (timer() < 300) // 5min
+    {
+        /*********************************************************************************
+        Non_state machine driven function
+        This functions will be called every cycle, use for safety and sensor functipons
+        **********************************************************************************/
+/*      safty() {
+
+        }
+
+        scanning() {
+        
+        }
+*/
 
-//indicator leds arround robot
-DigitalOut leds[] = { PC_8, PC_6, PB_12, PA_7, PC_0, PC_9 };
+    /*********************************************************************************
+    state machine driven function
+    This functions will only be called when there state is active.
+    The state machine will be in the same state until this action is completed or
+    a safty function kicks in and stops the current function.
+    Every function will return the next active state upon its transition table.
+    State and Transition Table will always be noted on the top of every state sheet
+    **********************************************************************************/
+        switch (state)
+        {
+        case 0:
+            //positioning
+
+            break;
+        case 20:
+            //mapping
+
+            break;
+        case 40:
+            //a-star
+
+            break;
+        case 60:
+            //moving
+
+            break;
+        case 80:
+            //grabing
+
+            break;
+        case 100:
+            //something
+
+            break;
+
+        case 120:
+            //something
+
+            break;
+        default:
+
+            printf("Fatal Error, Unkonwn state!");
+            break;
+        }
 
 
 
 
-static double time_counter = 0.0f;
-static double timer0 = 0.0f;
-bool status = 0;
 
-int main()
-{
-    move_init();
-    while(1) {
-        sync_movement(false,true);
-        wait(0.05);
     }
+
+    end_all();
 }
 
+int timer() {
 
+}
 
+void init() {
 
+}
+void end_all() {
+}
\ No newline at end of file