Show Posts
Pages: 1 2 3 [4] 5 6
46  Using Arduino / Project Guidance / Re: 40 bright fading multiple LEDs array on: June 10, 2011, 10:51:05 am
Yes I would like to have a pc here, but I just got a macbook with me..

Do you think I could use a 9 volta adapter which I used before for arduino projects? I think it should be fine cause it will power the board and it will give the right 5 volts to the chip using the 5 volt arduino power pin. Is that right?

Also, is there anyway I can give more power to the leds? They don't seem so bright as they were advertised on sparkfun (http://www.sparkfun.com/products/9850). Is there anyway to give them indepent power? That would be great..

thanks
47  Using Arduino / Project Guidance / Re: 40 bright fading multiple LEDs array on: June 10, 2011, 09:36:40 am
Yes, apparentely it works without deleting it now. All good then!

I tried quickly this morning, and when I added the other 16 leds for the second chip they all began to flicker and tremble.. Could it be a current problem? Did it happen to you guys?

I attach my code, my brother helped me out with it:

Code:
#include "Tlc5940.h"
 
  const float duePiMillis = 0.00628318531;      // Two time P divided by 1000
  const int maxValue = 2000;                    // Maximum value for the LED
  const int numOfChannels = 32;                  // Number of active channels

  // Array representing the duration of the cycles in seconds - don't need to reduce the number of channels!
  const float cycleDuration[] = {2, 4, 7, 10, 20, 10, 10, 90, 10, 10, 10, 10, 10, 10, 10, 10,

10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10}; //second chip


 
  int test = 1;
  int channel = 0;

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

void loop()
{
  Tlc.clear();
 
  while (test == 1)
  {
    long currentMillis = millis();    // Get the current millis
   // Serial.print("------------->");
    //Serial.println (currentMillis);
   
    for (channel = 0; channel < numOfChannels; channel++)
      {
        float numberOne = (currentMillis * duePiMillis);
        float numberTwo = numberOne / cycleDuration[channel];
        int myValue = (maxValue/2)+(maxValue/2)*(sin(numberTwo));
        Tlc.set(channel, myValue);
        Serial.print (channel);
        //Tlc.update(); //per fare la ola
      //  Serial.print(":");
        //Serial.print (myValue);
        //Serial.print("\t");
       
      }

  Tlc.update();
  //Serial.println ();
  }
}

Comments and advices are very welcome!!
48  Using Arduino / Project Guidance / Re: 40 bright fading multiple LEDs array on: June 09, 2011, 01:35:24 pm
Almost finished the coding.. i'll post that soon so you can check and tell me what you think. It seems to work!!
But I got another question about the chip: I tried to add another one, to see what it would like with 32 leds... but I can't find the file that should be deleted after making changes in the library (following the reference):

"All the options for the library are located in tlc_config.h, including NUM_TLCS, what pins to use, and the PWM period. After changing tlc_config.h, be sure to delete the Tlc5940.o file in the library folder to save the changes."

Tlc5940.o  Where is it????

thanks
49  Using Arduino / Project Guidance / Re: Tlc5940 random fading on: June 07, 2011, 06:49:05 pm
Could you post the working code, I am interested in the same thing

Thanks
50  Using Arduino / Project Guidance / Re: 40 bright fading multiple LEDs array on: June 07, 2011, 06:05:25 pm
Which using the chip would look like this:


Code:

#include "Tlc5940.h"

void setup()
{


  Tlc.init();
}

void loop()  {
 
Tlc.clear();

int test = 1;

while (test == 1) {

  for(int fadeValue = 10 ; fadeValue <= 4095; fadeValue +=50) {

    Tlc.set(5, fadeValue);         

Tlc.update();   
delay(30);                           
  }


  for(int fadeValue = 4095 ; fadeValue >= 10; fadeValue -=50) {

    Tlc.set(5, fadeValue);         

Tlc.update(); 
delay(30);                           
   }
 
 
 }
}


But of course I can't use this with more then one led because I am using the delay as time.. I couldn't figure out how to do it with millis cause they are such big numbers. is that doable? I also tried use the fade function from the library but it seems to work quite strangely with mine.. any examples test some of you made that I could try?

51  Using Arduino / Project Guidance / Re: 40 bright fading multiple LEDs array on: June 07, 2011, 04:06:10 pm
It's because of my broken English, sorry about that.
I will try make a real diagram tonight so that maybe someone could give me a hand, i'll try quickly to explain it again.

I am gonna use two tlc5940 connected with 32 leds (which will be inside of white ballons), which will fade up and down constantly.
Each led should move indipendently at a different speed so to create a nice moving effect.

This is a test code that I was using before buying the chips.. just to show you the kind of effect I'd like to have.

Code:
int ledPin = 9;    // LED connected to digital pin 9

void setup()  {
  // nothing happens in setup
 
    Serial.begin(9600);
}

void loop()  {
  // fade in from min to max in increments of 5 points:
   for(int fadeValue = 0 ; fadeValue <= 10; fadeValue +=1) {
    // sets the value (range from 0 to 255):
    analogWrite(ledPin, fadeValue);         
    // wait for 30 milliseconds to see the dimming effect   
    delay(20);       
Serial.println(fadeValue);     
  }
 
 
 
 
  // fade in from min to max in increments of 5 points:
   for(int fadeValue = 10 ; fadeValue <= 170; fadeValue +=1) {
    // sets the value (range from 0 to 255):
    analogWrite(ledPin, fadeValue);         
    // wait for 30 milliseconds to see the dimming effect   
    delay(20);       
Serial.println(fadeValue);     
  }
 
 
 
 
 

  // fade out from max to min in increments of 5 points:
  for(int fadeValue = 170 ; fadeValue >= 130; fadeValue -=1) {
    // sets the value (range from 0 to 255):
    analogWrite(ledPin, fadeValue);         
    // wait for 30 milliseconds to see the dimming effect   
    delay(5);           

Serial.println(fadeValue);         
  }
 
 
   for(int fadeValue = 130 ; fadeValue >= 20; fadeValue -=1) {
    // sets the value (range from 0 to 255):
    analogWrite(ledPin, fadeValue);         
    // wait for 30 milliseconds to see the dimming effect   
    delay(25);   

Serial.println(fadeValue);             
  }
 
 
  for(int fadeValue = 20 ; fadeValue >= 0; fadeValue -=1) {
    // sets the value (range from 0 to 255):
    analogWrite(ledPin, fadeValue);         
    // wait for 30 milliseconds to see the dimming effect   
    delay(10);   

Serial.println(fadeValue);             
  }
 delay(2000);
}


All the leds should act creating the same effect but with different timing. Same (more or less..) curve but one will last 5 seconds, one will last 10, another one 2 seconds.

Is that more clear? I really hope so! smiley
52  Using Arduino / Project Guidance / Re: 40 bright fading multiple LEDs array on: June 07, 2011, 03:23:38 pm
Ok, I received everything and I did the first basic tests using the examples from the library  (http://code.google.com/p/tlc5940arduino/).. it looks great! But now I have to understand how to make it do what I need. Basically I was thinking to define one basic function that could like like this: http://classes.kumc.edu/sah/resources/sensory_processing/images/bell_curve.gif (just to give an example) and then having each led behaving differently. Still using the same kind of function but changing the speed.. so that the final effect will be a series of different fading in and out depending on my tempo variable.

Do you know how to get started for this? The library seems a bit hard! Thanks again for supporting my silly questions..
53  Using Arduino / Project Guidance / Re: 40 bright fading multiple LEDs array on: June 04, 2011, 03:56:12 am
Cool, thanks a lot for your lessons guys! I am learning so much!

Anyway as my leds are just as single I think I am just going to follow this design: http://students.washington.edu/acleone/codes/tlc5940arduino/img/breadboard-arduino-tlc5940_close.png having all the plus together (as a common anode?) and using the negative voltage to control them. Right?

I will start with one and add the second.. I will need an external power supply right? Will 9 Volts be enough?

Thanks
54  Using Arduino / Project Guidance / Re: 40 bright fading multiple LEDs array on: June 03, 2011, 05:15:38 pm
Yes I like the PCB idea, let me know I might be interested in doing that together.

What do you mean for getting individual cathodes? I ordered this ones: http://www.sparkfun.com/products/9850



55  Using Arduino / Project Guidance / Re: 40 bright fading multiple LEDs array on: June 03, 2011, 03:24:10 pm
I received both the PCA9685 and the TLC5940, but the first one is def too small for my soldering skills.. i mean it's really procreating tiny, maybe i got the wrong model or something, it looks more to be used on preprinted circuits or similars.

So, following the TLC5940 way as suggest on here: http://tronixstuff.wordpress.com/2010/07/19/review-%E2%80%93-texas-instruments-tlc5940-16-channel-led-driver%C2%A0ic/ I was wondering if, in your opinion, there would be any difference between the leds array they use and the one that I am gonna buy (super bright from sparkfun, 20mA)

thanks to everyone!!
56  Using Arduino / Project Guidance / Re: 40 bright fading multiple LEDs array on: June 01, 2011, 04:52:48 pm
Couldn't find any place where to buy it, I got it on farnell now (http://uk.farnell.com/nxp/pca9685pw/ic-led-driver-rgba-28-tssop/dp/1854074?Ntt=PCA9685). Seems quite cool even if I am not sure wether I'll be able to program something for it, as the datasheet doesn't say much to me.. : (

I would be really interested in understanding more about it as it cost less then the TLC5940.. but as I said I am not sure I know enough..


thanks again to everyone, really appreciate this!
57  Using Arduino / Project Guidance / Re: 40 bright fading multiple LEDs array on: June 01, 2011, 04:32:23 pm
also thanks a lot Simpson_Jr.. i am gonna read everything slowly trying to get everything right! : )
58  Using Arduino / Project Guidance / Re: 40 bright fading multiple LEDs array on: June 01, 2011, 04:30:52 pm
What's this PCA9685? A controller? A chip? Can't find much online.. have you used it?

thanks
59  Using Arduino / Project Guidance / Re: 40 bright fading multiple LEDs array on: May 31, 2011, 06:25:15 pm
Thanks a lot.

I've got an arduino mega to use, so I wouldn't need to overcomplicate the circuit. I am happy to go for the simplest method, but would it be possible with really bright leds? Have you tried? I was looking into these: http://www.sparkfun.com/products/9850 (20mA, 3.2 V), would they be alright?

About the TLC5940 option, I am not entirely sure I understood everything. Will I have to do this for sure? 200mA will be just 10 leds... If i really need to use this, I guess I will need at least two of them to get 32 leds. How does the daisy chain works? Will the coding get much more complex? I could use 10 pin for two TLC5940, would that change anything? Please tell me a bit more about this, as I've never done it before


thanks again!!
 


60  Using Arduino / Project Guidance / 40 bright fading multiple LEDs array on: May 31, 2011, 04:20:56 pm
Hello,

I am trying to figure out how to develop my next project. I need 40 white leds to fade in and out using different speeds. I have used different types of arduino before but I can't find anything about how to interface this big number of leds. What would I need?

Thanks a lot in advance.
Pages: 1 2 3 [4] 5 6