A library for SPI control of adafruit's neopixel ring and addressable LEDs.
Dependents: TI_NEOPIXEL_SPI_SAMPLE
TI_NEOPIXEL_SPI.h@3:f0859c280204, 2020-01-02 (annotated)
- Committer:
- tichise
- Date:
- Thu Jan 02 08:14:13 2020 +0000
- Revision:
- 3:f0859c280204
- Parent:
- 2:0148ac5c90fa
- Child:
- 4:70bc3528e07e
BurstSPI in PixelArray could not be compiled with PlatformIO, so the library was changed to NeoPixel.
Who changed what in which revision?
User | Revision | Line number | New 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 | 3:f0859c280204 | 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 | 2:0148ac5c90fa | 27 | void chaseRainbow(int count); |
tichise | 0:c28aa7d4f97e | 28 | void circleRainbow(int count); |
tichise | 0:c28aa7d4f97e | 29 | rgbColor convertHsvToRgb(float h, float s, float v); |
tichise | 0:c28aa7d4f97e | 30 | |
tichise | 0:c28aa7d4f97e | 31 | private: |
tichise | 3:f0859c280204 | 32 | NeoPixelOut _neoPixel; |
tichise | 0:c28aa7d4f97e | 33 | }; |
tichise | 0:c28aa7d4f97e | 34 | |
tichise | 0:c28aa7d4f97e | 35 | #endif |