How to Control a Ton of RGB LEDs with Arduino & TLC5940

Ton of RGB LEDs

This video explains how to use the 16 channel PWM controller TLC5940

The CODE:

//Texas Instruments TLC 5940 with Arduino
//www.kevindarrah.com

#include <SPI.h>//Serial Peripheral Interface Library

  byte ch=0, chbit=0, spibit=0, spibyte=0;// variables used by tlc sub routine
  int SINData;//variable used to shift data to the TLC
  byte transferbyte[48];// bytes that are sent out to the tlc5940 via SPI
  // 48 because 16 channels @ 12bits gives 384bits, 384/8 = 48 bytes, 12 bit to 8 bit conversion
  byte DCvalue[32];//0-63, 6 bit DOT Correction Bytes
  int i, j, k, l,m,n; //misc variables
  int green, oldgreen= 2048;//for random animation
  int red, oldred = 2048;//for random animation
  int blue, oldblue = 2048;//for random animation
  int comeback=0, pick_color=0;//for random animation
  //*******************************************************************************************
  //*******************************************************************************************

 

Read more: How to Control a Ton of RGB LEDs with Arduino & TLC5940

Leave a Comment

Your email address will not be published. Required fields are marked *