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

Dependencies:   PixelArray

Dependents:   TI_NEOPIXEL_SPI_SAMPLE

Committer:
tichise
Date:
Tue Jul 09 15:25:16 2019 +0000
Revision:
0:c28aa7d4f97e
Child:
2:0148ac5c90fa
new

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 0:c28aa7d4f97e 18 void switchLightOff(int count);
tichise 0:c28aa7d4f97e 19 void switchLightOn(int count);
tichise 0:c28aa7d4f97e 20
tichise 0:c28aa7d4f97e 21 void changeColor(int count, rgbColor rgbColor);
tichise 0:c28aa7d4f97e 22 void changePointColor(int count, rgbColor topColor, rgbColor bottomColor);
tichise 0:c28aa7d4f97e 23
tichise 0:c28aa7d4f97e 24 void circle(int count, rgbColor rgbColor);
tichise 0:c28aa7d4f97e 25 void chase(int count, int bufferCount, rgbColor c1, rgbColor c2);
tichise 0:c28aa7d4f97e 26 void circleRainbow(int count);
tichise 0:c28aa7d4f97e 27 rgbColor convertHsvToRgb(float h, float s, float v);
tichise 0:c28aa7d4f97e 28
tichise 0:c28aa7d4f97e 29 private:
tichise 0:c28aa7d4f97e 30 neopixel::PixelArray _ledStrip;
tichise 0:c28aa7d4f97e 31 };
tichise 0:c28aa7d4f97e 32
tichise 0:c28aa7d4f97e 33 #endif