-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathRGB.h
More file actions
38 lines (34 loc) · 722 Bytes
/
RGB.h
File metadata and controls
38 lines (34 loc) · 722 Bytes
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
#include "Arduino.h"
//#include "stdio.h"
#ifndef RGB_h
#define RGB_h
class RGB {
public:
RGB(unsigned long rgbValue);
RGB(int red, int green, int blue);
int getRed();
int getGreen();
int getBlue();
unsigned long getRGB();
char* toString();
// std::string str();
private:
int _red;
int _green;
int _blue;
};
class RGBLED {
public:
RGBLED(int redPin, int greenPin, int bluePin);
void begin();
void setColor(RGB rgb);
void off();
void gradient(RGB startColor, RGB endColor, int durationInMS, int steps);
void gradient(RGB startColor, RGB endColor);
void gradient(unsigned long startColor, unsigned long endColor);
private:
int _redPin;
int _greenPin;
int _bluePin;
};
#endif