Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of SD600A by
LedStrip.h@23:2e60470dd134, 2012-10-12 (annotated)
- Committer:
- heroic
- Date:
- Fri Oct 12 04:16:23 2012 +0000
- Revision:
- 23:2e60470dd134
- Parent:
- 5:c2579d6415e1
- Child:
- 27:6667543f3b28
Move dat and clk back into private (since our interrupt routine is a member function, we can do this now.); ; Add logic to compute total luminance and hence current.
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| heroic | 5:c2579d6415e1 | 1 | |
| heroic | 5:c2579d6415e1 | 2 | // Mbed library to control HL1606-based RGB LED Strips |
| heroic | 5:c2579d6415e1 | 3 | // Partially based on work (c) 2011 Jelmer Tiete |
| heroic | 5:c2579d6415e1 | 4 | // |
| heroic | 5:c2579d6415e1 | 5 | // Ported from Arduino by |
| heroic | 5:c2579d6415e1 | 6 | // Jas Strong <jasmine@electronpusher.org> |
| heroic | 5:c2579d6415e1 | 7 | /*****************************************************************************/ |
| heroic | 4:0b75eb84a6d2 | 8 | |
| heroic | 4:0b75eb84a6d2 | 9 | // This is a pure virtual parent class for all LED strips, so that different types |
| heroic | 4:0b75eb84a6d2 | 10 | // of strip may be used in a single array or container. |
| heroic | 4:0b75eb84a6d2 | 11 | |
| heroic | 4:0b75eb84a6d2 | 12 | #include "mbed.h" |
| heroic | 4:0b75eb84a6d2 | 13 | #ifndef LEDSTRIP_H |
| heroic | 4:0b75eb84a6d2 | 14 | #define LEDSTRIP_H |
| heroic | 4:0b75eb84a6d2 | 15 | |
| heroic | 4:0b75eb84a6d2 | 16 | class LedStrip { |
| heroic | 4:0b75eb84a6d2 | 17 | public: |
| heroic | 4:0b75eb84a6d2 | 18 | virtual void begin(void)=0; |
| heroic | 4:0b75eb84a6d2 | 19 | virtual void show(void)=0; |
| heroic | 4:0b75eb84a6d2 | 20 | virtual void blank(void)=0; |
| heroic | 4:0b75eb84a6d2 | 21 | virtual void setPixelColor(uint16_t n, uint8_t r, uint8_t g, uint8_t b)=0; |
| heroic | 4:0b75eb84a6d2 | 22 | virtual void setPixelB(uint16_t n, uint8_t b)=0; |
| heroic | 4:0b75eb84a6d2 | 23 | virtual void setPixelG(uint16_t n, uint8_t g)=0; |
| heroic | 4:0b75eb84a6d2 | 24 | virtual void setPixelR(uint16_t n, uint8_t r)=0; |
| heroic | 4:0b75eb84a6d2 | 25 | virtual void setPixelColor(uint16_t n, uint32_t c)=0; |
| heroic | 4:0b75eb84a6d2 | 26 | virtual uint16_t numPixels(void)=0; |
| heroic | 4:0b75eb84a6d2 | 27 | virtual uint32_t Color(uint8_t, uint8_t, uint8_t)=0; |
| heroic | 23:2e60470dd134 | 28 | virtual uint32_t total_luminance(void); |
| heroic | 4:0b75eb84a6d2 | 29 | }; |
| heroic | 4:0b75eb84a6d2 | 30 | #endif |
