Adafruit TLC5947 Arduino Library
Public Member Functions | List of all members
Adafruit_TLC5947 Class Reference

Class that stores state and functions for interacting with TLC5947 24-channel PWM/LED driver. More...

#include <Adafruit_TLC5947.h>

Public Member Functions

 Adafruit_TLC5947 (uint16_t n, uint8_t c, uint8_t d, uint8_t l)
 Instantiates a new TLC5947 class. More...
 
 ~Adafruit_TLC5947 ()
 Releases allocated resources.
 
boolean begin (void)
 Setups the HW. More...
 
void setPWM (uint16_t chan, uint16_t pwm)
 Set the PWM channel / value. More...
 
uint16_t getPWM (uint16_t chan)
 Get the PWM value for channel. More...
 
void setLED (uint16_t lednum, uint16_t r, uint16_t g, uint16_t b)
 Set LED. More...
 
void write ()
 Writes PWM data to the all connected TLC5947 boards.
 

Detailed Description

Class that stores state and functions for interacting with TLC5947 24-channel PWM/LED driver.

Constructor & Destructor Documentation

◆ Adafruit_TLC5947()

Adafruit_TLC5947::Adafruit_TLC5947 ( uint16_t  n,
uint8_t  c,
uint8_t  d,
uint8_t  l 
)

Instantiates a new TLC5947 class.

Parameters
nnum of drivers (boards)
cArduino pin connected to TLC5947 clock pin
dArduino pin connected to TLC5947 data pin
lArduino pin connected to TLC5947 latch pin

Member Function Documentation

◆ begin()

boolean Adafruit_TLC5947::begin ( void  )

Setups the HW.

Returns
True if initialization was successful, otherwise false.

◆ setPWM()

void Adafruit_TLC5947::setPWM ( uint16_t  chan,
uint16_t  pwm 
)

Set the PWM channel / value.

Parameters
chanchannel number ([0 - 23] on each board, so channel 2 for second board will be 25)
pwmpwm value [0-4095]

◆ getPWM()

uint16_t Adafruit_TLC5947::getPWM ( uint16_t  chan)

Get the PWM value for channel.

Parameters
chanchannel number ([0 - 23] on each board, so channel 2 for second board will be 25)
Returns
PWM value ([0 - 4095]) for valid channels, 0 for non-existing channels.

◆ setLED()

void Adafruit_TLC5947::setLED ( uint16_t  lednum,
uint16_t  r,
uint16_t  g,
uint16_t  b 
)

Set LED.

Parameters
lednumled number
rred value [0-255]
ggreen value [0-255]
bblue value [0-255]

The documentation for this class was generated from the following files: