Driver for the GE Color Effects LED lights. Currently it is blocking, but it could be made to be nonblocking.
Dependents: GEColorEffects_Example GEColorEffects_Example
This library's code is based on Clark Jarvis's program here: http://developer.mbed.org/users/clarkjarvis/code/FRDM_GE_ColorEffects/
GEColorEffects.h@1:e56bc0a8c273, 2015-07-15 (annotated)
- Committer:
- bridadan
- Date:
- Wed Jul 15 20:04:49 2015 +0000
- Revision:
- 1:e56bc0a8c273
- Parent:
- 0:3f51641c4e69
Disabling irq around time sensitive parts. Added setBrightness function.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
bridadan | 0:3f51641c4e69 | 1 | #ifndef GE_COLOR_EFFECTS_H |
bridadan | 0:3f51641c4e69 | 2 | #define GE_COLOR_EFFECTS_H |
bridadan | 0:3f51641c4e69 | 3 | |
bridadan | 0:3f51641c4e69 | 4 | #include "mbed.h" |
bridadan | 0:3f51641c4e69 | 5 | |
bridadan | 0:3f51641c4e69 | 6 | class GEColorEffects { |
bridadan | 0:3f51641c4e69 | 7 | |
bridadan | 0:3f51641c4e69 | 8 | public: |
bridadan | 0:3f51641c4e69 | 9 | GEColorEffects(PinName pin, int size); |
bridadan | 1:e56bc0a8c273 | 10 | void setBrightness(unsigned char brightness); |
bridadan | 0:3f51641c4e69 | 11 | void write(int buf[], bool eightBit); |
bridadan | 0:3f51641c4e69 | 12 | |
bridadan | 0:3f51641c4e69 | 13 | private: |
bridadan | 0:3f51641c4e69 | 14 | int size; |
bridadan | 0:3f51641c4e69 | 15 | DigitalOut gpo; |
bridadan | 0:3f51641c4e69 | 16 | |
bridadan | 0:3f51641c4e69 | 17 | void sendZero(); |
bridadan | 0:3f51641c4e69 | 18 | void sendOne(); |
bridadan | 0:3f51641c4e69 | 19 | void sendData(unsigned char data, int length); |
bridadan | 0:3f51641c4e69 | 20 | void sendFrame(unsigned char address, unsigned char lumm, unsigned char R, unsigned char G, unsigned char B); |
bridadan | 0:3f51641c4e69 | 21 | void endFrame(); |
bridadan | 0:3f51641c4e69 | 22 | }; |
bridadan | 0:3f51641c4e69 | 23 | |
bridadan | 0:3f51641c4e69 | 24 | #endif |