forked from bracci/Qlockthree
-
Notifications
You must be signed in to change notification settings - Fork 0
/
LedDriverWS2801.h
47 lines (30 loc) · 912 Bytes
/
LedDriverWS2801.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
/*
LedDriverWS2801
*/
#ifndef LED_DRIVER_WS2801_H
#define LED_DRIVER_WS2801_H
#include "Arduino.h"
#include "LedDriver.h"
#include <Adafruit_WS2801.h>
class LedDriverWS2801 : public LedDriver {
public:
LedDriverWS2801(byte dataPin, byte clockPin);
void init();
void printSignature();
void writeScreenBufferToMatrix(word matrix[16], boolean onChange, eColors a_color = color_none);
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);
byte _brightnessScaleColor(byte brightness, byte colorPart);
Adafruit_WS2801 *_strip;
};
#endif