Go Down

Topic: ATtiny85 + TLC5940 (Read 6 times) previous topic - next topic

?R


OK, here's a copy of my library...hope somebody finds it useful!
http://www.artlum.com/arduino/tinytlc.html

thank you very much! i will try it asap! ;)
Riccardo Ertolupi of the Vicenza Thunders Team: http://www.VicenzaThunders.com

?R

well, i tried it and it worked very well: http://www.youtube.com/watch?v=3Br7PhvEIF0
thank you for sharing it! ;)
i had some problems because you suggested not to use millis and delays, but i see that the problems are caused only by delays, so we can use millis and micros... we just need to do the update method very often, right?
i've a question, i'm not an expert of making libraries, but to make this library work in an attiny84 do i just need to add this line?
Code: [Select]
#if defined (__AVR_ATtiny85__) || (__AVR_ATtiny84__)
or is there some register settings to do?
thanks again ;)
Riccardo Ertolupi of the Vicenza Thunders Team: http://www.VicenzaThunders.com

fungus


well, i tried it and it worked very well: http://www.youtube.com/watch?v=3Br7PhvEIF0
thank you for sharing it! ;)


No problem.

It's fun to think that the teeny chip in the corner is driving something that many LEDs... :)


i had some problems because you suggested not to use millis and delays, but i see that the problems are caused only by delays, so we can use millis and micros... we just need to do the update method very often, right?


I don't think millis() will do anything useful. I turned off the hardware timer in setup() (if it's ticking then there's a bug!)

Time spent in between calls to update() is time the LEDs aren't lit up. I think you'd have to do a lot before you notice them get visibly dimmer, but bear it in mind.


i've a question, i'm not an expert of making libraries, but to make this library work in an attiny84 do i just need to add this line?
Code: [Select]
#if defined (__AVR_ATtiny85__) || (__AVR_ATtiny84__)
or is there some register settings to do?
thanks again ;)


I just tried it and there's a line in setup() that doesn't compile. The line is:
Code: [Select]

  TCCR1 = 0;


It should work if you replace that line with:

Code: [Select]

#if defined (__AVR_ATtiny85__)
  TCCR1 = 0;
#else
  TCCR1A = TCCR1B = 0;
#endif

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

?R


I don't think millis() will do anything useful. I turned off the hardware timer in setup() (if it's ticking then there's a bug!)

Time spent in between calls to update() is time the LEDs aren't lit up. I think you'd have to do a lot before you notice them get visibly dimmer, but bear it in mind.

yes i noticed that, and i used millis and micros to synchronize the duration of functions and other things, i think it easier to use than the method that you used in your example code... i do something like this, and it acts like a delay, but it's useful for other things too:
Code: [Select]

#define TIME 100
...
_time=millis();
while(millis()- _time < TIME) tlc5940.update();



I just tried it and there's a line in setup() that doesn't compile. The line is:
Code: [Select]

  TCCR1 = 0;


It should work if you replace that line with:

Code: [Select]

#if defined (__AVR_ATtiny85__)
  TCCR1 = 0;
#else
  TCCR1A = TCCR1B = 0;
#endif

ok thank you, after i'll try that if i've time ;)
Riccardo Ertolupi of the Vicenza Thunders Team: http://www.VicenzaThunders.com

funkyguy4000

Whoa ?R, are those 2pin rgb fade leds or are those 4 pin rgb terminated leds?  They look to only have 2 pins.
Accelerate to 88 miles per hour.

Go Up