forked from bracci/Qlockthree
-
Notifications
You must be signed in to change notification settings - Fork 0
/
LedDriverLPD8806.h
62 lines (40 loc) · 1.09 KB
/
LedDriverLPD8806.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/*
LedDriverLPD8806
*/
#ifndef LED_DRIVER_LPD8806_H
#define LED_DRIVER_LPD8806_H
#include "Arduino.h"
#include "LedDriver.h"
#if defined(RGBW_LEDS) || defined(RGBW_LEDS_CLT2)
#include <LPD8806RGBW.h>
#else
#include <LPD8806.h>
#endif
class LedDriverLPD8806 : public LedDriver {
public:
LedDriverLPD8806(byte dataPin, byte clockPin);
void init();
void printSignature();
void writeScreenBufferToMatrix(word matrix[16], boolean onChange, eColors a_color);
void setBrightness(byte brightnessInPercent);
byte getBrightness();
void setLinesToWrite(byte linesToWrite);
void shutDown();
void wakeUp();
void clearData();
private:
byte _brightnessInPercent;
boolean _dirty;
void _setPixel(byte x, byte y, uint32_t c);
void _setPixel(byte num, uint32_t c);
uint32_t _wheel(byte brightness, byte wheelPos);
void _clear();
byte _brightnessScaleColor(byte brightness, byte colorPart);
unsigned int _lastLEDsOn;
#if defined(RGBW_LEDS) || defined(RGBW_LEDS_CLT2)
LPD8806RGBW *_strip;
#else
LPD8806 *_strip;
#endif
};
#endif