This is an example program for the PololuLedStrip library. It generates a simple moving gradient pattern.

Dependencies:   PololuLedStrip mbed LedStripGradient

Dependents:   LedStripGradient led_phare_crf

For more information, see the PololuLedStrip library.

Revision:
5:8b685ba2f16b
Parent:
4:27b5c9cafe92
Child:
6:59f1db26a9ff
--- a/main.cpp	Tue Feb 26 02:18:55 2013 +0000
+++ b/main.cpp	Tue Feb 26 02:25:19 2013 +0000
@@ -11,7 +11,7 @@
   } rgb_color;
   #endif
 
-  extern "C" int led_strip_write(rgb_color *, volatile uint32_t * set, volatile uint32_t * clear, uint32_t mask);
+  extern "C" int led_strip_write_color(rgb_color *, volatile uint32_t * set, volatile uint32_t * clear, uint32_t mask);
 
   class PololuLedStrip
   {
@@ -102,15 +102,18 @@
 
 DigitalOut myled2(LED2);
 
+#define LED_COUNT 60
+rgb_color colors[LED_COUNT];
+
 int main() {
     gpio_t gpio;
-    gpio_init(&gpio, LED1, PIN_OUTPUT);
+    gpio_init(&gpio, p8, PIN_OUTPUT);
 
     while(1) {
         myled2 = 1;
-        led_strip_write(NULL, gpio.reg_set, gpio.reg_clr, 1);
+        led_strip_write_color(colors, gpio.reg_set, gpio.reg_clr, gpio.mask);
         wait(0.2);
-        led_strip_write(NULL, gpio.reg_set, gpio.reg_clr, 0);
+        led_strip_write_color(colors, gpio.reg_set, gpio.reg_clr, gpio.mask);
         myled2 = 0;
         wait(1);
     }