forked from ForsakenNGS/PicoLED
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPicoLedController.hpp
More file actions
65 lines (57 loc) · 2.25 KB
/
PicoLedController.hpp
File metadata and controls
65 lines (57 loc) · 2.25 KB
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
63
64
65
#ifndef PICOLEDCONTROLLER_H
#define PICOLEDCONTROLLER_H
#include <cmath>
#include <algorithm>
#include <memory>
#include "pico/types.h"
#include "hardware/pio.h"
#include "PicoLedTarget.hpp"
using std::shared_ptr;
namespace PicoLed {
enum DrawMode {
MODE_SET=0,
MODE_ADD=1,
MODE_SUB=2
};
class PicoLedController {
public:
PicoLedController(shared_ptr<PicoLedTarget> target);
PicoLedController(PicoLedController& target, uint start, uint end);
~PicoLedController();
uint getNumLeds();
uint8_t getBrightness();
void setBrightness(uint8_t brightness);
DrawMode getDrawMode();
void setDrawMode(DrawMode mode);
Color getPixelColor(uint index);
void setPixelColor(uint index, Color color);
void setPixelColor(uint index, Color color, DrawMode mode);
void show();
void clear();
void clear(Color color);
void fill(Color color);
void fill(Color color, uint first);
void fill(Color color, uint first, uint count);
void fillGradient(Color colorStart, Color colorEnd);
void fillGradient(Color colorStart, Color colorEnd, uint first);
void fillGradient(Color colorStart, Color colorEnd, uint first, uint count);
void fillRainbow(uint8_t initialHue, uint8_t deltaHue);
void fillRainbow(uint8_t initialHue, uint8_t deltaHue, uint first);
void fillRainbow(uint8_t initialHue, uint8_t deltaHue, uint first, uint count);
void fade(Color color, double factor);
void fade(Color color, uint first, double factor);
void fade(Color color, uint first, uint count, double factor);
void fadeLine(Color color, double first, double factor);
void fadeLine(Color color, double first, double count, double factor);
void fadePixel(uint index, Color color, double factor);
void fadeValue(Color color, uint8_t value);
void fadeValue(Color color, uint first, uint8_t value);
void fadeValue(Color color, uint first, uint count, uint8_t value);
void fadePixelValue(uint index, Color color, uint8_t value);
PicoLedController slice(uint start, uint end);
protected:
shared_ptr<PicoLedTarget> target;
DrawMode mode;
};
};
#endif