Large TLC5940 project help needed!


hi all, of may have seen in irc chat, issue want illuminate balloons using rgb leds create pattern, here few videos show concept...



http://vimeo.com/3970281
http://vimeo.com/3970282

this want balloons do...

http://vimeo.com/4084501

as can see there lot of balloons control, 350 minimum want many can...

the issue having want fade through colours , can't further fading 3-5 rgb leds (which translates 9-15 pwm channels.

tlc5940 library - http://code.google.com/p/tlc5940arduino/

this code makes random choices modified other things.

can me solve scalability issue?

code: [select]
#include "tlc5940.h"
#include "tlc_fades.h"

int red = 2048;
int green = 4095;
int blue = 3893;

byte current_r[5], current_g[5], current_b[5];
tlc_channel_type channel = 1;

void setup() {
 tlc.init();
 serial.begin(9600);
}

void loop() {
   
 if (!tlc_updatefades()) {
   
   fadergb(channel, byte(random(0, 255)), byte(random(0, 255)), byte(random(0, 255)), 0, 500);
   channel++;
   if (channel >= 3) channel = 1;
   
 }
 
}

boolean fadergb(tlc_channel_type channel, byte r, byte g, byte b, uint32_t wait, uint32_t duration) {
 
 if (!rgbisfading(channel)) {
 
   tlc_channel_type redchannel = (channel * 3) - 3;
   tlc_channel_type greenchannel = (channel * 3) - 2;
   tlc_channel_type bluechannel = (channel * 3 ) - 1;
   
   tlc_removefades(redchannel);
   tlc_removefades(greenchannel);
   tlc_removefades(bluechannel);
       
 }
   
   uint32_t startfade = millis() + wait;
   uint32_t endfade = millis() + wait + duration;
   
   int fromred = map(int(current_r[channel-1]), 0, 255, 0, red);
   int fromgreen = map(int(current_g[channel-1]), 0, 255, 0, green);
   int fromblue = map(int(current_b[channel-1]), 0, 255, 0, blue);
 
   int tored = map(int(r), 0, int(0xff), 0, red);
   int togreen = map(int(g), 0, int(0xff), 0, green);
   int toblue = map(int(b), 0, int(0xff), 0, blue);
 
   tlc_channel_type redchannel = (channel * 3) - 3;
   tlc_channel_type greenchannel = (channel * 3) - 2;
   tlc_channel_type bluechannel = (channel * 3 ) - 1;
 
   tlc_addfade(redchannel, fromred, tored, startfade, endfade);
   tlc_addfade(greenchannel, fromgreen, togreen, startfade, endfade);
   tlc_addfade(bluechannel, fromblue, toblue, startfade, endfade);
   
   current_r[channel-1] = r;
   current_g[channel-1] = g;
   current_b[channel-1] = b;

}

boolean rgbisfading(tlc_channel_type channel) {
 if (tlc_isfading((channel * 3) - 3) && tlc_isfading((channel * 3) - 2) && tlc_isfading((channel * 3 ) - 1)) {
   return true;
 } else {
   return false;
 }
}

to control 350 rgb led's need 66 tlc5940's, lot of power , lot of money .-)

i think better use more 1 arduino board, , modular design project of magnitude.

also note spi bus used control tlc5940 intended work on rather short distances.


Arduino Forum > Forum 2005-2010 (read only) > Software > Interfacing > Large TLC5940 project help needed!


arduino

Comments

Popular posts from this blog

CAN'T INSTALL MAMBELFISH 1.5 FROM DIRECTORY - Joomla! Forum - community, help and support

error: expected initializer before 'void'

CPU load monitoring using GPIO and leds - Raspberry Pi Forums