Seattle, WA
Offline
Jr. Member
Karma: 0
Posts: 81
Arduino rocks my socks
|
 |
« Reply #30 on: September 09, 2008, 09:47:07 pm » |
Try deleting the .o file in library folder (<arduino folder>/hardware/libraries/TLC5940LED), then open the Arduino IDE again.
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Jr. Member
Karma: 0
Posts: 70
Slowly Developing
|
 |
« Reply #31 on: September 09, 2008, 11:15:09 pm » |
Bingo. Thanks.
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Jr. Member
Karma: 0
Posts: 70
Slowly Developing
|
 |
« Reply #32 on: September 13, 2008, 09:52:27 am » |
Have you run any fades over many hours? I've been testing a few different wave-like motions, and when I come back to them in the morning, things are either off-sync or "stuck" flickering between two pins. The fade action of each pin seems fine, it's just the timing that breaks. I thought it might be related to the millis() function, but last night I used a generic "Cylon" sweeper and it ended up stuck flickering between pins 5 and 7. Here's my crappy code: #include <TLC5940LED.h> int i; void setup() { Tlc.init(); Tlc.resetTimers(); }
void loop() { for(i=5;i<14;i+=2) { Tlc.newFade(i, 1500, 0, 4095); Tlc.newFade(i-2,1500,4095,0); while(Tlc.updateFades()); } for(i=13;i>2;i-=2) { Tlc.newFade(i, 1500, 0, 4095); Tlc.newFade(i+2, 1500, 4095, 0); while(Tlc.updateFades()); } } EDIT: I forgot to add that hitting the reset button gets things back to normal. And the "stuck" part of the cylon script is, as i said, between i=7 and i=5 on the second half. This didn't happen with the regular arduino PWM controls. I'm wondering if it's something inside updateFades()
|
|
|
|
« Last Edit: September 13, 2008, 10:01:25 am by nphillips »
|
Logged
|
|
|
|
|
0
Offline
Jr. Member
Karma: 0
Posts: 70
Slowly Developing
|
 |
« Reply #33 on: September 13, 2008, 11:09:20 am » |
Once again, I started poking around in the Library... if (fp->stopMillis <= currentMillis) As soon as the arduino's millis counter rolls over, this will get stuck in a 9-hour loop. I don't have anything off the top of my head right now, but I think a simple for or switch statement to check if the stopMillis is higher than the millis() rollover point.
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 40
I love YaBB 1G - SP1!
|
 |
« Reply #34 on: September 29, 2008, 08:55:48 am » |
Has anyone tested or used this library with Arduino IDE 12?
I can no longer use the library once I switched from 11 to 12
-nima
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Jr. Member
Karma: 0
Posts: 70
Slowly Developing
|
 |
« Reply #35 on: September 29, 2008, 10:40:41 am » |
I haven't upgraded yet, myself. No time to do so, and play around with this lib. acleone, the creator, seems to have "disappeared" for the time being. Apparently, we all get busy around the same time.  I still need to figure out a fix for the millis() issue I noted above. If I knew anything about what changes were made in IDE 12, and how to update libraries accordingly, I'd lend a hand. Unfortunately, I have no idea how to do it, nor do I currently have the time to try :/
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 40
I love YaBB 1G - SP1!
|
 |
« Reply #36 on: September 29, 2008, 12:14:38 pm » |
usually there is a limit for millis(), that's why it wraps around and it's not an issue specific to the TLC5940 library (it's arduino limit). But look around the forums for other solutions to the problem ( i *think* some ppl, once the millis reaches its limit, count down backwards or something)
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 40
I love YaBB 1G - SP1!
|
 |
« Reply #37 on: September 29, 2008, 01:14:52 pm » |
"As far as those 3V/80mA Sparkfun vibration motors are concerned, they seem to run fine at 500Hz, ramping up and down smoothly, based on prior experience. Alas, I won't be able to confirm with the TLC5940 for at least two weeks (vacation)."
I've used the TLC5940 to drive motors... a tip that usually emerges is to use diodes to protect the chip from any reverse current from the motors. I've used the tlc5940 with motors with diodes and without, and it never harmed the arduino or tlc5940 but it's good to use as a precaution
|
|
|
|
|
Logged
|
|
|
|
|
Austin, TX USA
Offline
God Member
Karma: 3
Posts: 992
Arduino rocks
|
 |
« Reply #38 on: September 29, 2008, 01:20:33 pm » |
Just to clarify, in Arduino 0011, the return value for millis() increments upwards by 1 per millisecond until it reaches 0x20C49B9 (about 9 1/2 hours) and then returns to 0 ("rolls over") and continues upward. In Arduino 0012, the rollover occurs at 0xFFFFFFFF, or about 49 days.
I haven't investigated the library code in particular, but I would suggest replacing
if (fp->stopMillis <= currentMillis)
with
// Version 0011 fix #define ROLLOVER 0x20C49BA if (currentMillis - fp->stopMillis % ROLLOVER < ROLLOVER/2)
or
// Version 0012 fix if (currentMillis - fp->stopMillis < 0x80000000)
Mikal
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Jr. Member
Karma: 0
Posts: 70
Slowly Developing
|
 |
« Reply #39 on: September 29, 2008, 03:44:18 pm » |
Thanks, mikel. I'll give that a go, soon. it's essentially what I was thinking, but I didn't have the knowledge to build it 
|
|
|
|
|
Logged
|
|
|
|
|
Malmo, Sweden
Offline
Newbie
Karma: 0
Posts: 9
|
 |
« Reply #40 on: October 06, 2008, 07:17:23 am » |
I have created a breakout board for this circuit for a more simple and quick build of projects and experiments. Take a look at http://www.instructables.com/id/The_Dawm/ where I have put a short instruction how to solder it together with some pictures. I also refer to your library acleone hope that is alright... The nice thing of the breakout board is that it is easily connectable after each other creating a lot of outputs fast together with the TLC5940 library If anyone is interested in a breakout board please mail me or soon look at http://blushingboy.org/ where it will be sold as soon as the page is ready...
|
|
|
|
« Last Edit: October 06, 2008, 09:27:05 am by zervez »
|
Logged
|
|
|
|
|
0
Offline
Jr. Member
Karma: 0
Posts: 70
Slowly Developing
|
 |
« Reply #41 on: October 06, 2008, 09:58:41 am » |
Good instructable, zervez!
I added a comment regarding the header pin soldering (as coffeebot). I'll keep an eye out for the boards on your site, for sure!
|
|
|
|
|
Logged
|
|
|
|
|
Seattle, WA
Offline
Jr. Member
Karma: 0
Posts: 81
Arduino rocks my socks
|
 |
« Reply #42 on: October 06, 2008, 12:14:27 pm » |
Nice breakout boards, zervez.
nphillips: I didn't see the new reply email until today, sorry! You're right about the 9-hour rollover bug. I'll fix that straight away (lazy coding in the first place always bites you in the back).
As for the problems with 0012, it's because the new millis() function disables interrupts while running. The library uses a few interrupts every time update() is called, so calling millis() right after an update might be the problem. I'll try running a few updates without millis to see if that fixes anything.
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Jr. Member
Karma: 0
Posts: 70
Slowly Developing
|
 |
« Reply #43 on: October 06, 2008, 01:22:51 pm » |
nphillips: I didn't see the new reply email until today, sorry! Not a problem. Life and monetary restrictions have put my project on hold, anyway. It's good to see that you're still interested though! (lazy coding in the first place always bites you in the back). I'm all too familiar with that one.
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 40
I love YaBB 1G - SP1!
|
 |
« Reply #44 on: October 08, 2008, 07:02:41 am » |
ok, thanks for taking a look at the 012 IDE issue.
|
|
|
|
|
Logged
|
|
|
|
|
|