Library to control NeoPixel strings of RGB leds

Dependencies:   PixelArray

Dependents:   NeoPixelI2cSlave NeoPixelI2cSlave

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers neopixel_string_factory.cpp Source File

neopixel_string_factory.cpp

00001 #include "neopixel_string_factory.h"
00002 
00003 NeoPixelString * NeoPixelStringFactory::createNeoPixelString(PinName spi_pin, unsigned int length) {
00004     // Create a temporary DigitalIn so we can configure the pull-down resistor.
00005     // (The mbed API doesn't provide any other way to do this.)
00006     // An alternative is to connect an external pull-down resistor.
00007     DigitalIn(spi_pin, PullDown);
00008     
00009     return new NeoPixelString(spi_pin, length);
00010 }