Drives a strip of serial RGB LEDs (WS2812) through SPI port (mosi: p5).
colors.h@0:f7ac8595c47a, 2015-05-23 (annotated)
- Committer:
- xkozima
- Date:
- Sat May 23 01:31:14 2015 +0000
- Revision:
- 0:f7ac8595c47a
This library drives WS2812 Serial RGB LED strips. See main.cpp as an example usage.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
xkozima | 0:f7ac8595c47a | 1 | #include "mbed.h" |
xkozima | 0:f7ac8595c47a | 2 | #include "BurstSPI.h" |
xkozima | 0:f7ac8595c47a | 3 | |
xkozima | 0:f7ac8595c47a | 4 | class Colors { |
xkozima | 0:f7ac8595c47a | 5 | public: |
xkozima | 0:f7ac8595c47a | 6 | void setup(int n); |
xkozima | 0:f7ac8595c47a | 7 | void send(unsigned char data[][3]); |
xkozima | 0:f7ac8595c47a | 8 | private: |
xkozima | 0:f7ac8595c47a | 9 | void sendOne(unsigned char r, unsigned char g, unsigned char b); |
xkozima | 0:f7ac8595c47a | 10 | int num; |
xkozima | 0:f7ac8595c47a | 11 | }; |