-
Notifications
You must be signed in to change notification settings - Fork 0
/
LedControl.h
54 lines (48 loc) · 1023 Bytes
/
LedControl.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
#ifndef LEDCONTROL_H
#define LEDCONTROL_H
#include "HardwareType.h"
//Defines that override FastLED defaults
#ifdef BATON
#define SPI_DATA 7
#define SPI_CLOCK 8
#endif
#ifdef STAFF
#define SPI_DATA 3
#define SPI_CLOCK 4
#endif
#include <FastLED.h>
#ifdef BATON
#define TRUE_LEDS 144
#define NUM_LEDS 35
#define COLOR_ORDER BGR
#define DATA_PIN 7
#define CLOCK_PIN 8
#define LED_TYPE APA102
#endif
#ifdef STAFF
#define TRUE_LEDS 138
#define NUM_LEDS 34
#define COLOR_ORDER BGR
#define DATA_PIN 3
#define CLOCK_PIN 4
#define LED_TYPE SK9822
#endif
enum LedAddressingMode {Direct, Mirror, Centered};
class LedControl
{
public:
LedControl();
uint8_t brightness;
uint8_t maxBrightness;
uint8_t minBrightness;
CRGB leds[TRUE_LEDS];
CRGB trueLeds[TRUE_LEDS];
void Clear();
void Refresh();
LedAddressingMode addressingMode;
//bool directMode;
private:
long lastUpdate;
const int fps = 100000 / 240;
};
#endif