Library to control NeoPixel strings of RGB leds

Dependencies:   PixelArray

Dependents:   NeoPixelI2cSlave NeoPixelI2cSlave

neopixel_string_factory.cpp

Committer:
dwini
Date:
2015-10-25
Revision:
0:66a5d46a740f

File content as of revision 0:66a5d46a740f:

#include "neopixel_string_factory.h"

NeoPixelString * NeoPixelStringFactory::createNeoPixelString(PinName spi_pin, unsigned int length) {
    // Create a temporary DigitalIn so we can configure the pull-down resistor.
    // (The mbed API doesn't provide any other way to do this.)
    // An alternative is to connect an external pull-down resistor.
    DigitalIn(spi_pin, PullDown);
    
    return new NeoPixelString(spi_pin, length);
}