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

Committer:
tomasero
Date:
Thu Sep 17 02:12:45 2015 +0000
Revision:
24:21d6d7016965
Parent:
23:a3c2ccd5870c
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.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
tomasero 24:21d6d7016965 1 //#include "mbed.h"
tomasero 24:21d6d7016965 2 //#include "PololuLedStrip.h"
tomasero 24:21d6d7016965 3 //
tomasero 24:21d6d7016965 4 //PololuLedStrip ledStrip(PTC8);
tomasero 24:21d6d7016965 5 //
tomasero 24:21d6d7016965 6 //#define LED_COUNT 60
tomasero 24:21d6d7016965 7 //rgb_color colors[LED_COUNT];
tomasero 24:21d6d7016965 8 //
tomasero 24:21d6d7016965 9 //Timer timer;
tomasero 24:21d6d7016965 10 //
tomasero 24:21d6d7016965 11 //int main()
tomasero 24:21d6d7016965 12 //{
tomasero 24:21d6d7016965 13 // timer.start();
tomasero 24:21d6d7016965 14 //
tomasero 24:21d6d7016965 15 // while(1)
tomasero 24:21d6d7016965 16 // {
tomasero 24:21d6d7016965 17 // // Update the colors array.
tomasero 24:21d6d7016965 18 // uint8_t time = timer.read_ms() >> 2;
tomasero 24:21d6d7016965 19 // for(uint32_t i = 0; i < LED_COUNT; i++)
tomasero 24:21d6d7016965 20 // {
tomasero 24:21d6d7016965 21 // uint8_t x = time - 8*i;
tomasero 24:21d6d7016965 22 // colors[i] = (rgb_color){ x, 255 - x, x };
tomasero 24:21d6d7016965 23 // }
tomasero 24:21d6d7016965 24 //
tomasero 24:21d6d7016965 25 // // Send the colors to the LED strip.
tomasero 24:21d6d7016965 26 // ledStrip.write(colors, LED_COUNT);
tomasero 24:21d6d7016965 27 // wait_ms(10);
tomasero 24:21d6d7016965 28 // }
tomasero 24:21d6d7016965 29 //}