Library for the WS2812 LED Driver. Uses bit banging and nops for precise timing. Number of nops executed are configurable at run time.
leds.h
- Committer:
- turumputum
- Date:
- 2020-06-24
- Revision:
- 3:31c18f8b2ddf
File content as of revision 3:31c18f8b2ddf:
#include "mbed.h" #include "PixelArray.h" #include "WS2812.h" #include "config.h" #define LedOff 0 #define LedWait 1 #define LedOn 3 #define LedBlink 4 #define LedRun 5 class LedGroupInside { public: LedGroupInside(PinName pin, int placeInTable, int size); //~LedGroup(); void light(int mode, int gS); private: PinName __outPin; int __mode; int __placeInTable; int __size; PixelArray __pa; WS2812 __leds; }; int color_set(uint8_t red,uint8_t green, uint8_t blue); void startUp_Led(); void fadeEffect(); void lightLeds(int gS);