-
Notifications
You must be signed in to change notification settings - Fork 7
/
LedDriver.h
56 lines (47 loc) · 1.09 KB
/
LedDriver.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
/******************************************************************************
LedDriver.h
******************************************************************************/
#ifndef LEDDRIVER_H
#define LEDDRIVER_H
#define FASTLED_ESP8266_RAW_PIN_ORDER
#include <FastLED.h>
#include <Arduino.h>
#include "Colors.h"
#include "Configuration.h"
#ifdef LED_RGB
#ifdef MATRIX_XXL
#define NUM_LEDS 225
#else
#define NUM_LEDS 115
#endif
#endif
#ifdef LED_RGBW
#ifdef LED_DRIVER_LPD8806
#ifdef MATRIX_XXL
#define NUM_LEDS 460
#else
#define NUM_LEDS 230
#endif
#else
#ifdef MATRIX_XXL
#define NUM_LEDS 225
#else
#define NUM_LEDS 115
#endif
#endif
#endif
class LedDriver {
public:
LedDriver();
void writeScreenBufferToLEDs(word matrix[16], uint8_t color);
void clear();
void setBrightness(uint8_t ledBrightness);
void getBrightness();
void show();
void setPixel(uint8_t num, uint8_t color);
private:
void setPixel(uint8_t x, uint8_t y, uint8_t color);
uint8_t getWhite(uint8_t red, uint8_t green, uint8_t blue);
CRGB leds[NUM_LEDS];
};
#endif