forked from gicmo/rgb-led
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Adafruit_TLC5947.h
47 lines (31 loc) · 1.19 KB
/
Adafruit_TLC5947.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
/***************************************************
This is a library for our Adafruit 24-channel PWM/LED driver
Pick one up today in the adafruit shop!
------> http://www.adafruit.com/products/1429
These drivers uses SPI to communicate, 3 pins are required to
interface: Data, Clock and Latch. The boards are chainable
Adafruit invests time and resources providing this open source code,
please support Adafruit and open-source hardware by purchasing
products from Adafruit!
Written by Limor Fried/Ladyada for Adafruit Industries.
BSD license, all text above must be included in any redistribution
****************************************************/
#ifndef _ADAFRUIT_TLC5947_H
#define _ADAFRUIT_TLC5947_H
#include <Arduino.h>
class Adafruit_TLC5947 {
public:
Adafruit_TLC5947(uint8_t n, uint8_t c, uint8_t d, uint8_t l);
boolean begin(void);
void setPWM(uint8_t chan, uint16_t pwm);
uint16_t getPWM(uint8_t chan);
void setLED(uint8_t lednum, uint16_t r, uint16_t g, uint16_t b);
void write(void);
uint16_t* getPWMBuffer();
uint8_t number_of_pins() const;
void reset();
private:
uint16_t *pwmbuffer;
uint8_t numdrivers, _clk, _dat, _lat;
};
#endif