Tlc5940 and IR library won't work together

I’m having problems getting the Tlc5940.h and the IRremote.h libraries to work to together. The Tlc5940 doesn’t do anything (no LEDS light) when the program is run, but the remote button 1 will cause the print statement in the case to show in the serial monitor. If I remark out the irrecv.enableIRIn(); line the Tlc5940 works (pins 13,14 and 15 light). Other programs that run either library always work the way I expect but I can’t get them to work together.

I’ve tried to changing the timer# in the IRremoteInt.h per;wap2. Also tried using pin 2 for the IR input. I’ve tried a couple different timer selections in the IRremote.h with the same results. I’ve also tried to run the RECV_PIN on a couple of different pins. Also down loaded the latest IR library from GitHub Shirriff

This is a simple sketch to debug the functions, the project is to to control 8 tri-color leds to simulate the four engine cycles in a V8 engine block that will be a coffee table. I want to use the remote to vary the speed and brightness, and to switch to constant color modes, and a night light mode. I got most of the code written before I got a IR receiver and then discovered I couldn’t get the code to run with the IR input added to control the switch/case statements.

Pretty much lost at this point…any help would be appreciated.


Arduino Uno, 1.0.2 software, Practical Maker PWM shield with 2 TLC5940 chips. Shield is on 12 Vcc, Arduino is on 9 Vcc.

#include <Tlc5940.h>
#include <IRremote.h>

int RECV_PIN = 5; // have tried different pins here

IRrecv irrecv(RECV_PIN);
decode_results results;

void setup()
 irrecv.enableIRIn(); // Start the receiver

 /* if I remark out the irrecv.enableIRIn line the led on pins 13,14 and 15 will light.
if irrecv.enableIin is not remarked out serial monitor will display the Serial.println, but no leds light.
//#define IR_USE_TIMER3   // tx = pin 5 


void loop()
  Tlc.set(13,1000); //red
  Tlc.set(15,1000); //blue
  if (irrecv.decode(&results)) {
    Serial.println(results.value, HEX);
     long int decCode = results.value;

switch (decCode){
  case 1637875967: // remote button 1
  Serial.println("in case 1637875967");

} //end of switch deCode
} //end of if irrecv
} //end of void loop

The TLC5940 library used by most folks gobbles up timers (timer 1 and timer 2). The IR library also needs a timer (I believe timer 1). The two libraries are fighting over timers.

There is an alternative TLC5940 library that uses just one timer. But it requires a fuse change; the GSCLK signal is output on CLKO.

I have a crude TLC5940 library that uses no additional timers. But it also requires a fuse change and has only been tested on the ATtiny84 processor.

thanks, I'll see if I can find the other library.