![](/media/cache/profiles/36388716_10156379864393903_5314622498057224192_n.jpg.50x50_q85.jpg)
Sample code for TI_NEOPIXEL_SPI
Diff: main.cpp
- Revision:
- 0:601717e4c63e
- Child:
- 2:e91690a04f44
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue Jul 09 15:29:02 2019 +0000 @@ -0,0 +1,36 @@ +#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); + } +} \ No newline at end of file