Hello!
I have problem to get my program to work. I know how to make simple things like using one array and one function but in this example i can't make em to work together .
I shall control 22 different leds and they shall change color and after a certain amount of time.
This is the values a want to use, it's the values to make one rgb led to be red.
Maybe it's easier to separate each led..
int redColor [6] = {4000,0,0,4000,0,0};
This is channels on my tlc5940. channel 1-3 is one rgb led for example and 4-6 is led nr2.
Maybe it's easier to separate each led..
int slooperLeds[6] = {1,2,3,4,5,6};
This how i'am trying to give led nr1 a red color. a-b-c is where i give the color values, and z-x-y is the pin numbers.
Tlc.set(x, a);
Tlc.set(y, b);
Tlc.set(z, c);
I have been trying many different things and do not remember all, but i have "//" some of em, i hope u guys don't i am stupid after seeing them but i have been trying around.
#include "Tlc5940.h"
int redColor [6] = {4000,0,0,4000,0,0};
int slooperLeds[6] = {1,2,3,4,5,6};
//int redColor = (4000,0,0,4000,0,0);
//int sloopersLeds = (1,2,3,4,5,6);
// ---------------------------------------------- Beginning of setup
void setup() {
Tlc.init();
}
// ----------------------------------------------- End of setup
// ----------------------------------------------- Beginning of loop
void loop() {
Tlc.update();
// sloopers = redColor[6]{0,1,2,3,4,5}, sloopersLeds = [6]{0,1,2,3,4,5};
// sloopers = redColor[6]{[0],[1],[2],[3],[4],[5]}, sloopersLeds = [6]{[1],[2],[3],[4],[5],[6};
// int sloopers = slooperLeds,redColor;
sloopers = slooperLeds,redColor;
Tlc.clear();
delay (1000);
}
// ----------------------------------------------- End of loop
// ----------------------------------------------- Function led 1-2
void sloopers (int x,int y,int z, int x2,int y2,int z2, int a, int b, int c , int a2, int b2, int c2);
{
Tlc.set(x, a);
Tlc.set(y, b);
Tlc.set(z, c);
Tlc.set(x2, a2);
Tlc.set(y2, b2);
Tlc.set(z2, c2);
}
// ----------------------------------------------- End of function led 1-2