A library for SPI control of adafruit's neopixel ring and addressable LEDs.
Dependents: TI_NEOPIXEL_SPI_SAMPLE
TI_NEOPIXEL_SPI.h
00001 #ifndef MBED_TI_NEOPIXEL_SPI_H 00002 #define MBED_TI_NEOPIXEL_SPI_H 00003 00004 #include "mbed.h" 00005 #include "neopixel.h" 00006 00007 typedef struct rgbColor 00008 { 00009 uint8_t red; 00010 uint8_t green; 00011 uint8_t blue; 00012 } rgbColor; 00013 00014 class TI_NEOPIXEL_SPI 00015 { 00016 public: 00017 TI_NEOPIXEL_SPI(PinName input); 00018 00019 void switchLightOff(int count); 00020 void switchLightOn(int count, int startCount, int endCount, rgbColor rgbColor); 00021 00022 void changeColor(int count, int startCount, int endCount, rgbColor rgbColor); 00023 void changePointColor(int count, int topIndex, int endIndex, rgbColor topColor, rgbColor bottomColor); 00024 00025 void circle(int count, int startCount, int endCount, rgbColor rgbColor); 00026 void chase(int count, int bufferCount, rgbColor c1, rgbColor c2); 00027 void chase2(int count, int bufferCount, rgbColor c1, rgbColor c2); 00028 void chaseReverse(int count, int bufferCount, rgbColor c1, rgbColor c2); 00029 00030 void chaseRainbow(int count, int bufferCount); 00031 void circleRainbow(int count); 00032 00033 void moon(int count, int startIndex, int stopIndex, rgbColor c1, rgbColor c2); 00034 00035 rgbColor convertHsvToRgb(float h, float s, float v); 00036 00037 private: 00038 neopixel::PixelArray _ledStrip; 00039 }; 00040 00041 #endif
Generated on Sun Jul 17 2022 05:08:06 by 1.7.2