A library for SPI control of adafruit's neopixel ring and addressable LEDs.

Dependencies:   PixelArray

Dependents:   TI_NEOPIXEL_SPI_SAMPLE

Committer:
tichise
Date:
Sat Jan 04 02:53:13 2020 +0000
Revision:
5:69bb2a2fa11f
Parent:
2:0148ac5c90fa
switched back to PixelArray

Who changed what in which revision?

UserRevisionLine numberNew contents of line
tichise 0:c28aa7d4f97e 1 #ifndef MBED_TI_NEOPIXEL_SPI_H
tichise 0:c28aa7d4f97e 2 #define MBED_TI_NEOPIXEL_SPI_H
tichise 0:c28aa7d4f97e 3
tichise 0:c28aa7d4f97e 4 #include "mbed.h"
tichise 0:c28aa7d4f97e 5 #include "neopixel.h"
tichise 0:c28aa7d4f97e 6
tichise 0:c28aa7d4f97e 7 typedef struct rgbColor
tichise 0:c28aa7d4f97e 8 {
tichise 0:c28aa7d4f97e 9 uint8_t red;
tichise 0:c28aa7d4f97e 10 uint8_t green;
tichise 0:c28aa7d4f97e 11 uint8_t blue;
tichise 0:c28aa7d4f97e 12 } rgbColor;
tichise 0:c28aa7d4f97e 13
tichise 0:c28aa7d4f97e 14 class TI_NEOPIXEL_SPI
tichise 0:c28aa7d4f97e 15 {
tichise 0:c28aa7d4f97e 16 public:
tichise 0:c28aa7d4f97e 17 TI_NEOPIXEL_SPI(PinName input);
tichise 5:69bb2a2fa11f 18
tichise 0:c28aa7d4f97e 19 void switchLightOff(int count);
tichise 2:0148ac5c90fa 20 void switchLightOn(int count, int startCount, int endCount, rgbColor rgbColor);
tichise 0:c28aa7d4f97e 21
tichise 2:0148ac5c90fa 22 void changeColor(int count, int startCount, int endCount, rgbColor rgbColor);
tichise 2:0148ac5c90fa 23 void changePointColor(int count, int topIndex, int endIndex, rgbColor topColor, rgbColor bottomColor);
tichise 0:c28aa7d4f97e 24
tichise 2:0148ac5c90fa 25 void circle(int count, int startCount, int endCount, rgbColor rgbColor);
tichise 0:c28aa7d4f97e 26 void chase(int count, int bufferCount, rgbColor c1, rgbColor c2);
tichise 5:69bb2a2fa11f 27 void chase2(int count, int bufferCount, rgbColor c1, rgbColor c2);
tichise 5:69bb2a2fa11f 28 void chaseReverse(int count, int bufferCount, rgbColor c1, rgbColor c2);
tichise 5:69bb2a2fa11f 29
tichise 5:69bb2a2fa11f 30 void chaseRainbow(int count, int bufferCount);
tichise 0:c28aa7d4f97e 31 void circleRainbow(int count);
tichise 5:69bb2a2fa11f 32
tichise 5:69bb2a2fa11f 33 void moon(int count, int startIndex, int stopIndex, rgbColor c1, rgbColor c2);
tichise 5:69bb2a2fa11f 34
tichise 0:c28aa7d4f97e 35 rgbColor convertHsvToRgb(float h, float s, float v);
tichise 0:c28aa7d4f97e 36
tichise 0:c28aa7d4f97e 37 private:
tichise 0:c28aa7d4f97e 38 neopixel::PixelArray _ledStrip;
tichise 0:c28aa7d4f97e 39 };
tichise 0:c28aa7d4f97e 40
tichise 0:c28aa7d4f97e 41 #endif