Projet_S5 / Mbed 2 deprecated Repo_Noeud_Mobile_refactor

Dependencies:   mbed-rtos mbed

Fork of Repo_Noeud_Mobile by Projet_S5

Revision:
3:a77d02cb5694
Parent:
1:601d2922ff06
Child:
5:2b539028e5a9
Child:
16:982409595a7a
--- a/main.cpp	Wed Mar 04 19:42:35 2015 +0000
+++ b/main.cpp	Thu Mar 05 19:04:27 2015 +0000
@@ -8,6 +8,7 @@
 #include "rtos.h"
 #include "FlexSensor.h"
 #include "CountDown.h"
+#include "Cible.h"
 
 #define GO 0x01
 
@@ -29,8 +30,7 @@
 
 int main(void const* args)
 {
-    GameMode mode = GUNNER;
-    countDown.run();
+    GameMode mode(GUNNER);
     switch(mode)
     {
         case GUNNER:
@@ -50,11 +50,17 @@
 void gunner(void const* args)
 { 
     // local variables 
+    Cible* cible = new Cible();
+    countDown.run();
     
     while(true)
     {
-        Thread::signal_wait(GO);
-        // code...
+        // Thread::signal_wait(GO);
+        cible->reset();
+        int target = rand() % 3;
+            
+        cible->set(target);
+        countDown.run();
     }
 }