Show Posts
Pages: [1]
1  Using Arduino / LEDs and Multiplexing / Re: How do I change the speed of fading with Tlc5940? on: October 11, 2012, 12:19:54 pm
Thanks again! Sorry for being such a neebie...
2  Using Arduino / LEDs and Multiplexing / Re: How do I change the speed of fading with Tlc5940? on: October 11, 2012, 09:37:36 am
Thank you johnwasser! Great...

Now, if I don´t want a total fade out, so that the LEDs never go down to zero, how do I make that happend?
3  Using Arduino / LEDs and Multiplexing / How do I change the speed of fading with Tlc5940? on: October 10, 2012, 01:03:56 pm
Hey, fresh meat here! I´ve just recently discovered Arduino and could use some help. I´m going to have 32 LEDs fading with seperate speeds in a organic way. I´ve been using example codes for some hours now, but the fading is way too rapid. I don´t know how to make a single LED to fade slow and smooth. Can you help me?

Below is the code I´m using right now, testing one LED. How do make the fading slower here?
Code:
#include "Tlc5940.h"
#include "tlc_fades.h"

TLC_CHANNEL_TYPE channel;

void setup()
{
  Tlc.init();
}

void loop()
{
  if (tlc_fadeBufferSize < TLC_FADE_BUFFER_LENGTH - 2) {
    if (!tlc_isFading(1)){
      uint16_t duration = 3000 - (analogRead(0) * 2);
      int maxValue = 4000;
      uint32_t startMillis = millis();
      uint32_t endMillis = startMillis + duration;
      tlc_addFade(1, 0, maxValue, startMillis, endMillis);
      tlc_addFade(1, maxValue, 0, endMillis, endMillis + duration);
      }
      
    if (channel++ == NUM_TLCS * 16) {
      channel = 0;
    }
  }
  tlc_updateFades();
}
4  Using Arduino / LEDs and Multiplexing / Re: How many LEDs can I fade using UNO? on: August 19, 2012, 02:34:13 pm
Oh, great... What about that fading SIN wire at the top of the diagram? Is that for additional TLC5940s or something?
5  Using Arduino / LEDs and Multiplexing / Re: How many LEDs can I fade using UNO? on: August 19, 2012, 01:04:41 pm
Btw, if I go with this diagram, I´ll still need resistors for each individual diod, right?
6  Using Arduino / LEDs and Multiplexing / Re: How many LEDs can I fade using UNO? on: August 18, 2012, 06:55:51 pm
Thank you! I´ll look it up as soon as my components arrive.
7  Using Arduino / LEDs and Multiplexing / Re: How many LEDs can I fade using UNO? on: August 18, 2012, 06:16:27 pm
Thanks for the tip, but I´m also looking for a cheap option... and I want regular diodes, no striped. It sounds interesting though. I think I´ll go with two TLC5940's.
8  Using Arduino / LEDs and Multiplexing / Re: How many LEDs can I fade using UNO? on: August 18, 2012, 12:45:09 pm
You could use two TLC5940's. That would give you 32 individually controllable PWM outputs.

http://arduino.cc/playground/Learning/TLC5940
https://www.sparkfun.com/products/10136

This sounds like a nice idea... Is this circuit schematic right? I probably need help with the code though.

Hey Tom carpenter, nice work. I have my little breadboard up and running with that fix. The LEDs are kind of pulsing, not together but at a similar rate, never fading to zero and seemingly never reaching full brightness. It's nice but...

Yeah, you can probably get a more organic pulse somehow. I don´t mind never reaching zero, but a more "breathing" pulse would be nice ofcourse.
9  Using Arduino / LEDs and Multiplexing / Re: How many LEDs can I fade using UNO? on: August 18, 2012, 07:27:18 am
Thanks for replies, though it´s all very complicated for me who´s neveer been into programing.  smiley-red

UDO: Sorry, I´ll use code tag next time. But yes, 20 LEDs would be enough. And the Blinkenlight will let you controll 20 LEDs individually? I didn´t find any experiment regarding LEDs "glowing at different speeds individually" on your blog. Do you have any ideas, or a code I could work with? I dont mean to be impatient, I just don´t have the time to learn all about coding right now. Thanks /

Tom: Thanks for the reply, seems like a similar idea. I´ve thought about using additional LEDs in series for the increase, but I want them all working their own "glow" so that idea isn´t organic enough for me. Hmm... The arduino Mega can control 15 PWM-channels with a similar code to the original that I was given?

10  Using Arduino / LEDs and Multiplexing / How many LEDs can I fade using UNO? on: August 17, 2012, 11:25:11 am
Hi. First of, I´m a total n00b at both Arduino and general programming.
I while ago a friend helped me out with a simple code for fading 6 LEDs in a sort of organic pulse.
Now I have a similar project, but my friend´s not here anymore and I have to ask around elsewhere.
For my new project I want the same organic fading flow, but with more diodes, maybe up to 24.
Is this possible with the UNO somehow? Help in a language I´ll manage is MUCH appreciated  smiley-red

This is the original 6-LED code:

/* 6LEDorganic*/


int    i;                                          // counter variable
float  LED[] = {1,1,1,1,1,1};                      //  pwm brightness variables
float  spChg[] = {1.006, 1.004, 1.008, 1.007, 1.005, 1.009};   // speed varialbes to fade LED's   - change these for faster or slower fades
// values should be close to and greater than 1
int    pwmPins[] = {3,5,6,9,10,11};                // PWM pins - 3,5,6 won't work on Atmega8
int     ud[]={1,1,1,1,1,1};                        // up - down multiplier

void setup() {
 Serial.begin(9600);
}

void loop() {
 for (i=0; i<=5; i++){
   if (LED > 255){
     ud = -3;
   }
   else if(LED < 38){
     ud = 1;   
   }
   
   if (ud == 1){       // up flag, multiply spChg variable
  LED = LED * spChg;    // multiply by a fixed amount - spCh array controls the speed of fade
   }
   else
   {                     // down flay,  divide spChg variable
  LED = LED / spChg;
   }
   
   analogWrite(pwmPins, (int)LED);
   delay(1);        // this will interact with the spChg variables to control ultimate fade speed
 }
}
Pages: [1]