![](/media/cache/profiles/36388716_10156379864393903_5314622498057224192_n.jpg.50x50_q85.jpg)
Sample code for TI_NEOPIXEL_SPI
Diff: main.cpp
- Revision:
- 2:e91690a04f44
- Parent:
- 0:601717e4c63e
- Child:
- 5:dc96362ec4d5
--- a/main.cpp Wed Jul 10 16:38:25 2019 +0000 +++ b/main.cpp Sun Jul 28 00:13:22 2019 +0000 @@ -3,7 +3,9 @@ TI_NEOPIXEL_SPI pixelArray(p11); -int pixelCount = 16; +int totalNumOfRingLED = 8+16+24+35; // 8+16+24+35 +int startNumOfRingLED = 35+24; +int endNumOfRingLED = 35+24+16; int main() { @@ -12,22 +14,18 @@ while(1) { if (isRed) { // pixelArray.switchLightOff(pixelCount); - // pixelArray.changeColor(pixelCount, (rgbColor) {50, 10, 170}); - pixelArray.circleRainbow(pixelCount); + // pixelArray.changeColor(totalNumOfRingLED, startNumOfRingLED, endNumOfRingLED, (rgbColor) {50, 10, 170}); + pixelArray.chaseRainbow(totalNumOfRingLED); } else { - rgbColor topColor = (rgbColor) {255, 0, 0}; - rgbColor bottomColor = (rgbColor) {0, 32, 255}; + // 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.circle(totalNumOfRingLED, startNumOfRingLED, endNumOfRingLED, circleColor); - // pixelArray.switchLightOn(pixelCount); - // pixelArray.changeColor(pixelCount, (rgbColor) {255, 255, 255}); + // pixelArray.switchLightOn(totalNumOfRingLED, startNumOfRingLED, endNumOfRingLED, pixelCount); + // pixelArray.changeColor(totalNumOfRingLED, startNumOfRingLED, endNumOfRingLED, (rgbColor) {255, 255, 255}); } isRed = !isRed;