CRAC Team / Mbed 2 deprecated led_phare_crf

Dependencies:   mbed LedStripGradient PololuLedStrip

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "PololuLedStrip.h"
00003 
00004 PololuLedStrip ledStrip(D9);
00005 
00006 #define LED_COUNT 60
00007 rgb_color colors[LED_COUNT];
00008 
00009 Timer timer;
00010 
00011 int main()
00012 {
00013     uint8_t u=0;
00014     timer.start();
00015 
00016     while(1)
00017     {
00018         // Update the colors array.
00019         //uint8_t time = timer.read_ms() >> 2;
00020         for(uint32_t i = 0; i < LED_COUNT; i++)
00021         {
00022             //uint8_t x = time - 1*i;
00023             colors[i] = (rgb_color){ 0, 0, 0 };
00024         }
00025         
00026         colors[u] = (rgb_color){ 255, 255, 255 };
00027         u++;
00028         if(u>=LED_COUNT)u=0;
00029     
00030         // Send the colors to the LED strip.
00031         ledStrip.write(colors, LED_COUNT);
00032         wait_ms(15); 
00033     }
00034 }