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:
17:1a634bb615f3
--- a/CountDown/CountDown.cpp	Wed Mar 04 19:42:35 2015 +0000
+++ b/CountDown/CountDown.cpp	Thu Mar 05 19:04:27 2015 +0000
@@ -1,9 +1,10 @@
 #include "CountDown.h"
-
+Serial pc(USBTX, USBRX);
 CountDown::CountDown(int time)
     // initialisation list
     : t(time>>2) /// division par 4 pour temps entre ch. LED. 
 {
+    //pc.printf("constructor time %i \r\n", t);
     led[0] = new DigitalOut(LED1);
     led[1] = new DigitalOut(LED2);
     led[2] = new DigitalOut(LED3);
@@ -25,15 +26,17 @@
     for(int i(0); i<j ; i++){ // ALL ON. 
         led[i]->write(1);
     }
-
+    
     while(j) // Actual CountDown. 
     {
+        j--;
+        pc.printf("run\r\n");
         Thread::wait(t);
-        j--;
-        led[j] = 0;
+        pc.printf("after wait \r\n");
+        led[j]->write(0);
     }
     
-    for(int u(0); u<NBRE_LED; u++) // Flashing State
+    for(int u(0); u < NBRE_LED; u++) // Flashing State
     {
         Thread::wait(100);
         for(int i(0); i<NBRE_LED ; i++){