Forum
Mehrere TLC5940 an Arduino Uno (Elektronik)
Tach auch.
Mein Problem: Daisy-Chain von mehreren TLC5940 an einem Arduino UNO (ATMEL 328).
Mein Projekt: 320 LED-Stripes mittels 20xTLC5940 via Arduino ansteuern.
Hat von Euch Profis einer einen Tip, was ich falsch mache oder wo mein Denkfehler liegt? Icg benutze die Arduino-Lib "Tlc5940" von Alex Leone (siehe Anhang) + Compiler Arduino 1.6.6. Die dazugehörige "tlc_config.h" habe ich für meine Tests mit (nur) zwei TLCs geändert (#define NUM_TLCS 2). Der zweite TLC macht vorerst nicht das, was er soll. Bevor das nicht funktioniert, brauche ich mit den anderen daisy-chained TLCs gar nicht erst anfangen.
Ich bräuchte da wirklich mal Eure Hilfe...
Vielen lieben Dank.
Paule
Hier mein Arduino-Test-Sketch:
// _1st_Try_TLC5940.ino
/*
* TLC5940 - Simple Example: fading up/down color/LED step ba step + running white flash
* WEMFR, 2017-11-18
* not database stored, just a test
*/
#include "Tlc5940.h"
/* --- compiler variables --- */
#define COLORS 3 // 0 = blue, 1 = green, 2 = red, 3 = white, 4 = uv
#define LEDS 5
#define BLUE 0
#define GREEN 1
#define RED 2
#define WHITE 3
#define UV 4
#define MAXBRIGTHNESS 4095 // max. 4095
#define LOWBRIGTHNESS MAXBRIGTHNESS/10 // reduced brightness
#define WAIT 1000 // microseconds
#define DEBUG // just define it for debug-mode via serial monitor
/* --- end compiler variables --- */
/* --- local variables --- */
byte Color[] = {RED,GREEN,BLUE,WHITE,UV};
/* --- end local variables --- */
void setup()
{
Tlc.init(0); // Initiates the TLC5940 and set all channels off
Serial.begin(9600);
Serial.println("TLC5940 - Test. File: _1st_Try_TLC5940.ino");
#if !defined(DEBUG)
Serial.end();
#endif
}
void loop() {
//
for (int k = 0; k < COLORS; k++) // COLOR 0...2 // for each color
{
#if defined(DEBUG)
Serial.println("Color " + String(k));
#endif
for (int j = 0; j < LEDS; j++) // each LED, one by one
{
#if defined(DEBUG)
Serial.println("LED " + String(j));
#endif
for (int i = 0; i < LOWBRIGTHNESS; i++) // will fade up
{
Tlc.set(j*COLORS+Color[k], i);
Tlc.update();
delayMicroseconds(WAIT);
}
}
for (int i = LOWBRIGTHNESS; i >= 0; i--) // all LEDs will fade down at the same time
{
for (int j = 0; j < LEDS; j++)
{
Tlc.set(j*COLORS+Color[k], i);
}
Tlc.update();
delayMicroseconds(WAIT);
}
}
// running flash
delay(1000);
for (int j = 0; j < LEDS; j++)
{
for (int k = 0; k < COLORS; k++)
{
Tlc.set(j*COLORS+Color[k], MAXBRIGTHNESS);
}
Tlc.update();
delay(50);
Tlc.clear();
Tlc.update();
delay(50);
}
delay(1000);
}
http://www.elektronik-kompendium.de/forum/upload/20171120184757.zip
Gesamter Thread:


