Adafruit TLC59711
Adafruit_TLC59711.h
Go to the documentation of this file.
1 
22 #ifndef _ADAFRUIT_TLC59711_H
23 #define _ADAFRUIT_TLC59711_H
24 
25 #include <Adafruit_SPIDevice.h>
26 #include <Arduino.h>
27 
33 public:
34  Adafruit_TLC59711(uint8_t n, uint8_t c, uint8_t d);
35  Adafruit_TLC59711(uint8_t n, SPIClass *theSPI = &SPI);
36 
37  bool begin();
38 
39  void setPWM(uint16_t chan, uint16_t pwm);
40  void setLED(uint8_t lednum, uint16_t r, uint16_t g, uint16_t b);
41  void getLED(uint8_t lednum, uint16_t &r, uint16_t &g, uint16_t &b);
42  void write();
43  void setBrightness(uint8_t bcr, uint8_t bcg, uint8_t bcb);
44  void simpleSetBrightness(uint8_t BC);
45 
46 private:
47  uint16_t *pwmbuffer = NULL;
48 
49  uint8_t BCr = 0, BCg = 0, BCb = 0;
50  int8_t numdrivers = 0;
51  Adafruit_SPIDevice *_spi_dev = NULL;
52 };
53 
54 #endif
Class that stores state and functions for interacting with TLC59711 Senor.
Definition: Adafruit_TLC59711.h:32
void write()
Writes PWM buffer to board.
Definition: Adafruit_TLC59711.cpp:70
void setBrightness(uint8_t bcr, uint8_t bcg, uint8_t bcb)
Set the brightness of LED channels to specific value.
Definition: Adafruit_TLC59711.cpp:185
void simpleSetBrightness(uint8_t BC)
Set the brightness of LED channels to same value.
Definition: Adafruit_TLC59711.cpp:166
bool begin()
Begins SPI connection if there is not empty PWM buffer.
Definition: Adafruit_TLC59711.cpp:215
void setLED(uint8_t lednum, uint16_t r, uint16_t g, uint16_t b)
Set RGB value for selected LED.
Definition: Adafruit_TLC59711.cpp:136
void getLED(uint8_t lednum, uint16_t &r, uint16_t &g, uint16_t &b)
Get RGB value for selected LED.
Definition: Adafruit_TLC59711.cpp:154
void setPWM(uint16_t chan, uint16_t pwm)
Set PWM value on selected channel.
Definition: Adafruit_TLC59711.cpp:119
Adafruit_TLC59711(uint8_t n, uint8_t c, uint8_t d)
Instantiates a new Adafruit_TLC59711 class.
Definition: Adafruit_TLC59711.cpp:39