Gestion d'un chenillard

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
Kemix
Date:
Wed Mar 11 08:22:24 2015 +0000
Commit message:
Chenillard fonctionnel

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r 951fd71eb3ba main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Mar 11 08:22:24 2015 +0000
@@ -0,0 +1,25 @@
+#include "mbed.h"
+
+int main(){
+    DigitalOut *led[4];
+    led[0] = new DigitalOut(LED1);
+    led[1] = new DigitalOut(LED2);
+    led[2] = new DigitalOut(LED3);
+    led[3] = new DigitalOut(LED4);
+    int i;
+    *led[0] = 0;
+    *led[1] = 0;
+    *led[2] = 0;
+    *led[3] = 0;
+    
+    while(1){
+        for(i=0;i<4;i++){
+            wait(0.5);
+            *led[i] = 1;
+        }
+        for(i=4;i>0;i--){
+            wait(0.5);
+            *led[i-1] = 0;
+        }
+    }
+}
\ No newline at end of file
diff -r 000000000000 -r 951fd71eb3ba mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Mar 11 08:22:24 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/7e07b6fb45cf
\ No newline at end of file