Seattle
Offline
Jr. Member
Karma: 0
Posts: 79
Haxorz? In MY Computerz? Its liklyr than you think
|
 |
« on: October 28, 2010, 12:02:13 pm » |
Hey guys: Heres the lib I've been working on for a couple of months now (Well... more like a bunch of functions, but I'm working on incorporating it into a class and eventually its own library :p ). These are a bunch of functions (and a framework) for using PWM over Shift Registers (specificly 74HC595's). The library us used for just general RGB LED's, as that is what it is specifacly set up for. It wouldent take much code, though, to make it work for general PWM tho ;D. In fact, I'm working on adding this functionality to the library now... Heres a vidio of it in action: [media]http://www.youtube.com/watch?v=C3s8qDhUwlo [/media] Happy coding! Heres the souce code: (754 lines, 22667 chars  ) http://drafts.thatcompdude.com/arduino/RGB_led_pwmViaShift2_ver5/RGB_led_pwmViaShift2_ver5.pdeHere are versions 2 - 5. Dont bother using anything older than ver5 tho, there old and VERY pre-alpha quality http://drafts.thatcompdude.com/arduino/
|
|
|
|
« Last Edit: October 28, 2010, 06:04:26 pm by KnuttyD »
|
Logged
|
|
|
|
|
Seattle WA
Offline
Full Member
Karma: 1
Posts: 205
Arduino rocks
|
 |
« Reply #1 on: October 28, 2010, 12:13:49 pm » |
That's awesome. I have a couple of PCBs I'm selling on my website ( www.logos-electro.com) that use daisy-chained 595s to drive high current outputs. Would you mind if I linked to your code once it's up?
|
|
|
|
|
Logged
|
|
|
|
|
Seattle
Offline
Jr. Member
Karma: 0
Posts: 79
Haxorz? In MY Computerz? Its liklyr than you think
|
 |
« Reply #2 on: October 28, 2010, 12:35:38 pm » |
That's awesome. I have a couple of PCBs I'm selling on my website ( www.logos-electro.com) that use daisy-chained 595s to drive high current outputs. Would you mind if I linked to your code once it's up? Yea, sure you can. I am working on integrating the code into another one of my projects (which I may or may not make open source), so in the future it /may/ not be open to the public (probably will stay open tho ;D ). I would love to help you with your project. The code it set up so its not very hard to make it work for just about any PWM (or just basic HIGH/LOW) output to 595's.
|
|
|
|
|
Logged
|
|
|
|
|
North Yorkshire, UK
Offline
Faraday Member
Karma: 104
Posts: 5531
|
 |
« Reply #3 on: October 28, 2010, 01:03:54 pm » |
Well that's freaky.
I think about RGB LEDs and how to run a load of them. Think of shift registers then remember that they aren't PWM...
Less than a minute later... see this thread!
Cool stuff! I will be testing it out!
Mowcius
|
|
|
|
|
Logged
|
|
|
|
|
San Jose, California
Offline
Newbie
Karma: 0
Posts: 20
Teaching you to fish. Metaphorically speaking.
|
 |
« Reply #4 on: October 28, 2010, 01:49:05 pm » |
This is a great project, thank you for working on it for the community!
I look forward to learning from your code.
|
|
|
|
|
Logged
|
|
|
|
|
North Yorkshire, UK
Offline
Faraday Member
Karma: 104
Posts: 5531
|
 |
« Reply #5 on: October 28, 2010, 01:56:57 pm » |
Mowcius waits patiently for KnuttyD to return home 
|
|
|
|
|
Logged
|
|
|
|
|
|
|
San Jose, California
Offline
Newbie
Karma: 0
Posts: 20
Teaching you to fish. Metaphorically speaking.
|
 |
« Reply #7 on: October 28, 2010, 07:12:27 pm » |
Huge thanks! It is people like you that keep me learning and experimenting.
I look forward to someday sharing innovations of my own.
Cheers,
-Miles
|
|
|
|
|
Logged
|
|
|
|
|
Seattle
Offline
Jr. Member
Karma: 0
Posts: 79
Haxorz? In MY Computerz? Its liklyr than you think
|
 |
« Reply #8 on: October 29, 2010, 09:02:30 pm » |
More minor fixes in the lib
+Faster ISR +Clean up variable defs
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 34
Arduino rocks
|
 |
« Reply #9 on: October 30, 2010, 04:18:28 pm » |
Hmm I'm working on some home automation project (lots of PWM controlled LED's included, more than my arduino mega can handle) so I think this is what i'm looking for BUT i never worked with a shift register. I know i can get myself to the point to understand them but a shematic and a sample code would be really awesome. insertbegemotehere-> : 
|
|
|
|
|
Logged
|
|
|
|
|
Sao Paulo - Brazil
Offline
Sr. Member
Karma: 0
Posts: 268
|
 |
« Reply #10 on: October 30, 2010, 11:28:15 pm » |
great!!
Could you draw your circuit schematic?? thanks..
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 1
Posts: 43
Arduino rocks
|
 |
« Reply #11 on: November 03, 2010, 06:50:46 am » |
Any chance you can document or explain the code ?
I've have a read through and think I see whats going on but would like to be sure.
I'd like to make use of this instead of using tlc5940s (too expensive, hard to get hold of and currently in my prototype flickering madly) but might have to squeeze a few more 74595s into it for my project. I assume the quantity that it can drive is down to the time taken to shift the data out within each interrupt ?
|
|
|
|
« Last Edit: November 03, 2010, 06:51:05 am by defsdoor »
|
Logged
|
|
|
|
|
Seattle
Offline
Jr. Member
Karma: 0
Posts: 79
Haxorz? In MY Computerz? Its liklyr than you think
|
 |
« Reply #12 on: November 09, 2010, 01:27:21 pm » |
Sure, I'll try to get to it soon! For now, take a look at the ShiftOut() tutorial. the registers are hooked up almost Exactly like they are in the tutorial. Placement of the LED's on the registers is a little harder, tho :  . Ill try to get a schematic up soon.
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 6
Arduino rocks
|
 |
« Reply #13 on: November 14, 2010, 11:30:24 pm » |
still have a lot to learn, so forgive my ignorance.
Are you using common anode or common cathode? Why? Do you think that this would work with the other type?
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 4
All Steez No Cheese
|
 |
« Reply #14 on: November 18, 2010, 11:21:57 pm » |
if it's not too much trouble could you please post the schematic? I'm trying to figure out whether to use this or some tlc940s for my project.
|
|
|
|
|
Logged
|
|
|
|
|
|