-
Notifications
You must be signed in to change notification settings - Fork 0
/
ws2812B.h
62 lines (45 loc) · 860 Bytes
/
ws2812B.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
57
58
59
60
61
62
/** @file WS2812B.h
*
* @author Wassim FILALI
* Inferred from the Datasheet
*
*
* @compiler gcc for STM32
*
*
* started on local project on 10.10.2015
* this file was created for refactoring on 03.01.2016
* takeover for STM32 on 02.12.2017
* $Date:
* $Revision:
*
*/
#ifndef __ws2812B__
#define __ws2812B__
#include "mbed.h"
typedef struct
{
uint8_t R;
uint8_t G;
uint8_t B;
}rgb_t;
namespace ws
{
namespace color
{
const rgb_t red = {255,0,0};
const rgb_t green = {0,255,0};
const rgb_t blue = {0,0,255};
const rgb_t black = {0,0,0};
const rgb_t white = {255,255,255};
}
}
class ws2812B
{
public:
ws2812B(PinName pio);
void set(uint8_t R,uint8_t G,uint8_t B);
private:
DigitalOut rgbout;
};
#endif /*__ws2812B__*/