Code fonctionnel pour le chenillard de led du phare GE1

Dependencies:   mbed LedStripGradient PololuLedStrip

Files at this revision

API Documentation at this revision

Comitter:
AlexisCollin
Date:
Fri Mar 13 08:48:24 2020 +0000
Parent:
16:66404dec28db
Commit message:
Code fonctionnel pour le chenillard de led du phare

Changed in this revision

LedStripGradient.lib Show annotated file Show diff for this revision Revisions of this file
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 66404dec28db -r 4cb4930316d9 LedStripGradient.lib
--- a/LedStripGradient.lib	Wed Nov 01 23:14:16 2017 +0000
+++ b/LedStripGradient.lib	Fri Mar 13 08:48:24 2020 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/DavidEGrayson/code/LedStripGradient/#a6258776625e
+https://os.mbed.com/users/DavidEGrayson/code/LedStripGradient/#66404dec28db
diff -r 66404dec28db -r 4cb4930316d9 main.cpp
--- a/main.cpp	Wed Nov 01 23:14:16 2017 +0000
+++ b/main.cpp	Fri Mar 13 08:48:24 2020 +0000
@@ -1,7 +1,7 @@
 #include "mbed.h"
 #include "PololuLedStrip.h"
 
-PololuLedStrip ledStrip(D8);
+PololuLedStrip ledStrip(D9);
 
 #define LED_COUNT 60
 rgb_color colors[LED_COUNT];
@@ -10,20 +10,25 @@
 
 int main()
 {
+    uint8_t u=0;
     timer.start();
 
     while(1)
     {
         // Update the colors array.
-        uint8_t time = timer.read_ms() >> 2;
+        //uint8_t time = timer.read_ms() >> 2;
         for(uint32_t i = 0; i < LED_COUNT; i++)
         {
-            uint8_t x = time - 8*i;
-            colors[i] = (rgb_color){ x, 255 - x, x };
+            //uint8_t x = time - 1*i;
+            colors[i] = (rgb_color){ 0, 0, 0 };
         }
+        
+        colors[u] = (rgb_color){ 255, 255, 255 };
+        u++;
+        if(u>=LED_COUNT)u=0;
     
         // Send the colors to the LED strip.
         ledStrip.write(colors, LED_COUNT);
-        wait_ms(10);        
+        wait_ms(15); 
     }
 }
diff -r 66404dec28db -r 4cb4930316d9 mbed.bld
--- a/mbed.bld	Wed Nov 01 23:14:16 2017 +0000
+++ b/mbed.bld	Fri Mar 13 08:48:24 2020 +0000
@@ -1,1 +1,1 @@
-https://os.mbed.com/users/mbed_official/code/mbed/builds/fb8e0ae1cceb
\ No newline at end of file
+https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400
\ No newline at end of file