Sample code for TI_NEOPIXEL_SPI

Dependencies:   TI_NEOPIXEL_SPI

main.cpp

Committer:
tichise
Date:
2019-07-09
Revision:
0:601717e4c63e
Child:
2:e91690a04f44

File content as of revision 0:601717e4c63e:

#include "mbed.h"
#include "TI_NEOPIXEL_SPI.h"

TI_NEOPIXEL_SPI pixelArray(p11);

int pixelCount = 16;

int main()
{
    bool isRed = false;

    while(1) {
        if (isRed) {
            // pixelArray.switchLightOff(pixelCount);
            // pixelArray.changeColor(pixelCount, (rgbColor) {50, 10, 170});
            pixelArray.circleRainbow(pixelCount);

        } else {
            rgbColor topColor = (rgbColor) {255, 0, 0};
            rgbColor bottomColor = (rgbColor) {0, 32, 255};
        
            pixelArray.changePointColor(pixelCount, topColor, bottomColor);

            /*
            rgbColor circleColor = (rgbColor){50, 10, 170};
            pixelArray.circle(pixelCount, circleColor);
            */
            
            // pixelArray.switchLightOn(pixelCount);
            // pixelArray.changeColor(pixelCount, (rgbColor) {255, 255, 255});
        }
        isRed = !isRed;

        wait(2);
    }
}