This library lets you control the addressable RGB LED strips from Pololu Robotics. Forked to add selectable colour order (Support RGB or GRB Leds)

Fork of PololuLedStrip by David Grayson

Revision:
22:5368af3ff07d
Parent:
19:46d7ab0ba3e7
Child:
23:881d93b8749a
--- a/PololuLedStrip.cpp	Tue Nov 26 23:05:08 2013 +0000
+++ b/PololuLedStrip.cpp	Thu Sep 08 23:14:02 2016 +0000
@@ -17,7 +17,7 @@
     }
     else
     {
-        // Try to generally compute what the delays should be for a ide range of clock frequencies.
+        // Try to generally compute what the delays should be for a wide range of clock frequencies.
         
         // The fudge factors below were experimentally chosen so that we would have
         // ~100/840 ns pulses and a ~1430 ns period on the mbed NXP LPC1768 (96 MHz Cortex-M3).
@@ -30,15 +30,13 @@
     }
  
     // Convert from units of cycles to units of half-cycles; it makes the assembly faster.   
-    for(int i = 0; i < 2; i++)
-    {
-        led_strip_write_delays[i] <<= 1;
-    }
+    led_strip_write_delays[0] <<= 1;
+    led_strip_write_delays[1] <<= 1;
 }
 
 PololuLedStrip::PololuLedStrip(PinName pinName)
 {
-    gpio_init(&gpio, pinName, PIN_OUTPUT);
+    gpio_init_out(&gpio, pinName);
 }
 
 void PololuLedStrip::write(rgb_color * colors, unsigned int count)