I trying to control 7 RGB Led strips(12V) using arduino with Jitter.
I think almost finished, because they(TLC 5940, ULN2003) worked well when I tested separately. But I can't connect both of them, even though some people said they connected in this forum. I found some picture and followed it. However, it doesn't work. I hooked up pull up resistor(10K) on one of ULN2003 inputs with arduino 5V. And LED(12V) hooked up ULN2003 Ground.
(I connected 12V power supply for LED strips.)
Help me, please.
Also, I have very simple patch arduino.
If you give me any advice, I will appreciate it.
Thank you so much.
/* Tlc.set(channel (0-15), value (0-4095)) sets the grayscale value for
one channel (15 is OUT15 on the first TLC, if multiple TLCs are daisy-
chained, then channel = 16 would be OUT0 of the second TLC, etc.).
value goes from off (0) to always on (4095).
Like Tlc.clear(), this function only sets up the data, Tlc.update()
will send the data. */
#include "Tlc5940.h"
int incomingByte;
unsigned long duration;
void setup() {
Serial.begin(115200);
Tlc.init();
/* Call Tlc.init() to setup the tlc.
You can optionally pass an initial PWM value (0 - 4095) for all channels.*/
}
void loop() {
Tlc.clear();
byte Rdim1;
Rdim1 = map(Rdim1, 0, 4095, 0, 255);
byte Gdim1;
Gdim1 = map(Gdim1, 0, 4095, 0, 255);
byte Bdim1;
Bdim1 = map(Bdim1, 0, 4095, 0, 255);
byte Rdim2;
Rdim2 = map(Rdim2, 0, 4095, 0, 255);
byte Gdim2;
Gdim2 = map(Gdim2, 0, 4095, 0, 255);
byte Bdim2;
Bdim2 = map(Bdim2, 0, 4095, 0, 255);
byte Rdim3;
Rdim3 = map(Rdim3, 0, 4095, 0, 255);
byte Gdim3;
Gdim3 = map(Gdim3, 0, 4095, 0, 255);
byte Bdim3;
Bdim3 = map(Bdim3, 0, 4095, 0, 255);
byte Rdim4;
Rdim4 = map(Rdim4, 0, 4095, 0, 255);
byte Gdim4;
Gdim4 = map(Gdim4, 0, 4095, 0, 255);
byte Bdim4;
Bdim4 = map(Bdim4, 0, 4095, 0, 255);
byte Rdim5;
Rdim5 = map(Rdim5, 0, 4095, 0, 255);
byte Gdim5;
Gdim5 = map(Gdim5, 0, 4095, 0, 255);
byte Bdim5;
Bdim5 = map(Bdim5, 0, 4095, 0, 255);
byte Rdim6;
Rdim6 = map(Rdim6, 0, 4095, 0, 255);
if(Serial.available() >= 16)
{
byte Rdim1 = Serial.read();
byte Gdim1 = Serial.read();
byte Bdim1 = Serial.read();
byte Rdim2 = Serial.read();
byte Gdim2 = Serial.read();
byte Bdim2 = Serial.read();
byte Rdim3 = Serial.read();
byte Gdim3 = Serial.read();
byte Bdim3 = Serial.read();
byte Rdim4 = Serial.read();
byte Gdim4 = Serial.read();
byte Bdim4 = Serial.read();
byte Rdim5 = Serial.read();
byte Gdim5 = Serial.read();
byte Bdim5 = Serial.read();
byte Rdim6 = Serial.read();
Tlc.set(0, Rdim1);
Tlc.set(1, Gdim1);
Tlc.set(2, Bdim1);
Tlc.set(3, Rdim2);
Tlc.set(4, Gdim2);
Tlc.set(5, Bdim2);
Tlc.set(6, Rdim3);
Tlc.set(7, Gdim3);
Tlc.set(8, Bdim3);
Tlc.set(9, Rdim4);
Tlc.set(10, Gdim4);
Tlc.set(11, Bdim4);
Tlc.set(12, Rdim5);
Tlc.set(13, Gdim5);
Tlc.set(14, Bdim5);
Tlc.set(15, Rdim6);
Tlc.update();
}
}