Forked PololuLedStrip and modified it to work with the KL25Z. Renamed it to Adafruit_NeoPixel.

Dependents:   idd_hw3 idd_fa15_hw3_lauren_bill_tomas idd_fa15_hw3_lauren_bill_tomas Raiden ... more

Fork of PololuLedStrip by David Grayson

Files at this revision

API Documentation at this revision

Comitter:
tomasero
Date:
Thu Sep 17 02:12:45 2015 +0000
Parent:
23:a3c2ccd5870c
Commit message:
To my understanding, the common gpio library no longer supports gpio_init having three arguments where the third is the pin mode. Thus, I modified the PololuLedStrip constructor to utilize gpio_init_out(&gpio, pinName); so that is sets it to output.

Changed in this revision

Examples/LedStripGradient.cpp Show annotated file Show diff for this revision Revisions of this file
PololuLedStrip.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r a3c2ccd5870c -r 21d6d7016965 Examples/LedStripGradient.cpp
--- a/Examples/LedStripGradient.cpp	Wed Sep 16 22:37:58 2015 +0000
+++ b/Examples/LedStripGradient.cpp	Thu Sep 17 02:12:45 2015 +0000
@@ -1,29 +1,29 @@
-#include "mbed.h"
-#include "PololuLedStrip.h"
-
-PololuLedStrip ledStrip(PTC8);
-
-#define LED_COUNT 60
-rgb_color colors[LED_COUNT];
-
-Timer timer;
-
-int main()
-{
-    timer.start();
-
-    while(1)
-    {
-        // Update the colors array.
-        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 };
-        }
-    
-        // Send the colors to the LED strip.
-        ledStrip.write(colors, LED_COUNT);
-        wait_ms(10);        
-    }
-}
+//#include "mbed.h"
+//#include "PololuLedStrip.h"
+//
+//PololuLedStrip ledStrip(PTC8);
+//
+//#define LED_COUNT 60
+//rgb_color colors[LED_COUNT];
+//
+//Timer timer;
+//
+//int main()
+//{
+//    timer.start();
+//
+//    while(1)
+//    {
+//        // Update the colors array.
+//        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 };
+//        }
+//    
+//        // Send the colors to the LED strip.
+//        ledStrip.write(colors, LED_COUNT);
+//        wait_ms(10);        
+//    }
+//}
diff -r a3c2ccd5870c -r 21d6d7016965 PololuLedStrip.cpp
--- a/PololuLedStrip.cpp	Wed Sep 16 22:37:58 2015 +0000
+++ b/PololuLedStrip.cpp	Thu Sep 17 02:12:45 2015 +0000
@@ -38,7 +38,7 @@
 
 PololuLedStrip::PololuLedStrip(PinName pinName)
 {
-    gpio_init(&gpio, pinName, PIN_OUTPUT);
+    gpio_init_out(&gpio, pinName);
 }
 
 void PololuLedStrip::write(rgb_color * colors, unsigned int count)