Hello I'm a beginner with Arduino and I got same problem.
I've to clear the solution but it works and it's something.
You have to
backup and then
edit .../arduinoIDEfolder/libraries/TLC5940/pinouts/chip_includes.hafter the abbrevation port definitions (many sentences like '#define PB0 PORTB0') delete all and left it like this:
/* Copyright blablabla*/
#ifndef TLC_CHIP_INCLUDES_H
#define TLC_CHIP_INCLUDES_H
/** \file
Includes the chip-specfic defaults and pin definitions. */
#include <avr/io.h>
#ifndef PB0
#define PB0 PORTB0
...
#define PH7 PORTH7
#endif
/* Chip Specific Pinouts */
#if defined (__AVR_ATmega32U4__)
/* Leonardo */
#include "Arduino_Leonardo.h"
#else
#error "Unknown Chip!"
#endif
#endif
Then
copy 'Teensy_xxU4.h' (in the same folder),
rename the copy to 'Arduino_Leonardo.h' and
edit it like this:
#ifndef TLC_Teensy_xxU4_h
#define TLC_Teensy_xxU4_h
#if DATA_TRANSFER_MODE == TLC_BITBANG
#error "If you want bitbang mode, insert pin defs here"
#endif
// MOSI (Leo outter center ICSP pin) -> SIN (TLC pin 26)
#define TLC_MOSI_PIN 2
#define TLC_MOSI_PORT PORTB
#define TLC_MOSI_DDR DDRB
// SCK (Leo inner center ICSP pin) -> SCLK (TLC pin 25)
#define TLC_SCK_PIN 1
#define TLC_SCK_PORT PORTB
#define TLC_SCK_DDR DDRB
// SS (Leo RX LED)
#define TLC_SS_PIN 0
#define TLC_SS_DDR DDRB
// OC1A (Leo pin 9) -> XLAT (TLC pin 24)
#define XLAT_PIN 5
#define XLAT_PORT PORTB
#define XLAT_DDR DDRB
// OC1B (Leo pin 10) -> BLANK (TLC pin 23)
#define BLANK_PIN 6
#define BLANK_PORT PORTB
#define BLANK_DDR DDRB
// OC3A (Leo pin 5) -> GSCLK (TLC pin 18)
#define GSCLK_PIN 6
#define GSCLK_PORT PORTC
#define GSCLK_DDR DDRC
#define TLC_TIMER3_GSCLK 1
#endif
You must advise that the pin numbers are different to the Teensy, even more, you must use the SCK and MOSI signals from the ICSP connector (not mapped to digital pins in Leonardo) and the SS signal from the RX LED board). See the next images for more help (the first is for the ICSP detail algthou is not Leonardo board, and the second is for the board conection to the SS signal)
ICSP:
http://www.gammon.com.au/images/ArduinoUno_R3_Pinouts.pngSS:
http://provideyourown.com/wordpress/wp-content/uploads/rx-pin-150x148.jpgBe sure too that in
.../arduinoIDEfolder/libraries/TLC5940/tlc_config.h you have correctly the numbers of TLC you're using '#define NUM_TLCS 2' (for 2 TLC5940's) at Line55
I hope this helps anyone new with Arduino Leonardo board and the TLC5940 chip.
Sorry for my english.