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

Files at this revision

API Documentation at this revision

Comitter:
DavidEGrayson
Date:
Thu Sep 08 23:14:02 2016 +0000
Parent:
21:87fd6273e0ff
Child:
23:881d93b8749a
Commit message:
Updated the mbed library and fixed an incorrect assembly instruction.

Changed in this revision

PololuLedStrip.cpp Show annotated file Show diff for this revision Revisions of this file
led_strip_write_color.s Show annotated file Show diff for this revision Revisions of this file
--- 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)
--- a/led_strip_write_color.s	Tue Nov 26 23:05:08 2013 +0000
+++ b/led_strip_write_color.s	Thu Sep 08 23:14:02 2016 +0000
@@ -65,7 +65,6 @@
 
     delay #0
 
-    tst r6, r8
     ldr r4, =0x80000000
     tst r6, r4
     beq delay1