![]() |
![]() |
![]() |
|
|
|||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
|
|
Thread Tools | Display Modes |
|
|
(permalink) |
|
I know there are 100's of RGB LED circuits and programs out there, but here's my take on things
I've made a program that allows the user to control the brightness of each LED from 0 to 100% by modifying a register from 0 to 255 for each color What makes this program different? I back up the system registers before the interrupt, and restore them afterwards, so your main program could be doing absolutely anything (within reason), and the three PWM signals will function perfectly, and are all editable on-the-fly It also includes a very handy mS register that can be used anywhere in the main program to create delays and the such, eg; Code:
Red_Duty = 0 // Clear the Red_Duty register
While Red_Duty < 255 // Create a loop condition
Inc(Red_Duty) // Increment the Red Duty Cycle
mS = 0 // Clear the mS register
repeat
until mS = 10 // Wait for 10mS to elapse
wend
The Common Anode RGB LED's I used can be found here (they are very bright and have very vivid colors) ![]() You can get very stunning effects with these LED's, and the video's I took didn't give them the justice! I used three LED's and a large white semi transparent bowl to diffuse the light and make a "mood rock" type feature. RGB Practicle.wmv - File Shared from Box.net - Free Online File Storage ![]() More info about the program and circuit can be found here
__________________
Spency. PIC Micro's - Your mind is the limit PIC's and interfacing with other devices - a PIC Basic Guide @ digital-diy.net Last edited by gramo; 28th May 2008 at 10:11 AM. |
|
|
|
|
|
|
(permalink) |
|
Spency,
Nice demo and video. Those LEDs do look incredibly bright. May I ask which LEDs you're using on that Vendor page? Did you say you were using individual Red, Green, and Blue LEDs in your video? Mike |
|
|
|
|
|
|
(permalink) |
|
The LED's are these ones
I've got 3 in the circuit shown, but its just as bright and crisp with 2 (even with 1 it looks great). I was really surprised just how clean and balanced and vivid the color components were with these LED's, with past RGB LED's I have had to tone down either red or green to get a decent white balance. If anything, it was way to bright, and thats why I had to turn the container around (to get rid of the extremely bright spot on the side the LED's were on). You can just see the glare of the bright side in the images at the back of the container; ![]()
__________________
Spency. PIC Micro's - Your mind is the limit PIC's and interfacing with other devices - a PIC Basic Guide @ digital-diy.net |
|
|
|
|
|
|
(permalink) |
|
I was probably referring to each color chip within the LED's - the LED's used were 5mm RGB Common Anode LED's
__________________
Spency. PIC Micro's - Your mind is the limit PIC's and interfacing with other devices - a PIC Basic Guide @ digital-diy.net |
|
|
|
|
|
|
(permalink) |
|
Nice demo Gramo, I'll have to give it a try.
|
|
|
|
|
|
|
(permalink) |
|
Thanks Bill
__________________
Spency. PIC Micro's - Your mind is the limit PIC's and interfacing with other devices - a PIC Basic Guide @ digital-diy.net |
|
|
|
|
|
|
(permalink) |
|
As pointed out in a different thread, you could remove the context saving in the interrupt routine should you want less code overhead in the main program.
eg; Remove the red code Code:
Interrupt TMR2_Interrupt()
High(Signal_Pin)
Save(0) // Back up system variables
If TMR2IF = 1 Then // Check if the interrupt was from TMR2
TMR2IF = 0 // Clear the TMR2 interrupt flag
uS = uS + 50
If uS >= 1000 Then
uS = uS - 1000
Inc(mS)
EndIf
Inc(Red_DutyVal)
Inc(Green_DutyVal)
Inc(Blue_DutyVal)
If Red_DutyVal > Red_Duty or red_Duty = 0 Then
Red_Pin = 0
Else
Red_Pin = 1
EndIf
If Green_DutyVal > Green_Duty or Green_Duty = 0 Then
Green_Pin = 0
Else
Green_Pin = 1
EndIf
If Blue_DutyVal > Blue_Duty or Blue_Duty = 0 Then
Blue_Pin = 0
Else
Blue_Pin = 1
EndIf
EndIf //
Restore // Restore system variables
Low(Signal_Pin)
End Interrupt
__________________
Spency. PIC Micro's - Your mind is the limit PIC's and interfacing with other devices - a PIC Basic Guide @ digital-diy.net |
|
|
|
|
|
|
(permalink) |
|
hmm, seems I highlighted the wrong line on the bottom, and I can no longer edit - any chance of a moderator fixing that?
The lower red line should be Code:
Restore // Restore system variables
__________________
Spency. PIC Micro's - Your mind is the limit PIC's and interfacing with other devices - a PIC Basic Guide @ digital-diy.net |
|
|
|
|
|
|
(permalink) |
|
Damed that 15 minute edit time. I have deleted a post because of this, and really screwed up the thread, as people quoted the deleted post and anyone reading it would be lost...lol Learned that the hard way. 15 minutes is a bit short for this type of forum, since allot go back and fix or update their posts. It saves posting 10 times by adjusting your original post, alway put and EDIT: indicator so people can see it was modified. Any chance of raising this time limit Mods?
Cheers, -BaC
__________________
Error: {Panic!} when trying to load: [reality shell]. kernel: "universe has been halted"... Information Underground |
|
|
|
|
|
|
(permalink) |
|
You thinks those are bright check these out: Common Anode 8000MCD Super Flux RGB LED-The Electronic Goldmine
totally blinding!!!!!
__________________
Error: {Panic!} when trying to load: [reality shell]. kernel: "universe has been halted"... Information Underground |
|
|
|
|
|
|
(permalink) |
|
I reckon they'd be fairly close. They are the same current and almost the same Vf.
Core Electronics - Red Green Blue CA 5mm LED I've already emailed CE to get a MCD/mlm rating for the LED's because im interested to know what they are I modified the project afterwards (and the examples on the site) for a single RGB LED, and it was just as good (actually better, as there were no "bright" spots)
__________________
Spency. PIC Micro's - Your mind is the limit PIC's and interfacing with other devices - a PIC Basic Guide @ digital-diy.net |
|
|
|
|
|
|
(permalink) |
|
Its a fun project though, you can make some nice effects with this sort of thing
__________________
Spency. PIC Micro's - Your mind is the limit PIC's and interfacing with other devices - a PIC Basic Guide @ digital-diy.net |
|
|
|
|
|
|
(permalink) |
|
I think 48-72 hours would be good. 24 hours minimum. 15 minutes is ridiculous for this type of forum!
__________________
========================= Futz's Microcontrollers & Robotics ========================= |
|
|
|
|
|
|
(permalink) | |
|
Have to admit they did look very blinding, since that bright spot was pretty intense. Usually their even brighter in person
-BaC Not saying that is what is going on, they may just be in the process, as they tighten the design. Quote:
__________________
Error: {Panic!} when trying to load: [reality shell]. kernel: "universe has been halted"... Information Underground |
||
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Latest |
| "Program verify failed at program address 0x000, progra | Jimmy Vivas | Micro Controllers | 17 | 25th July 2008 01:35 AM |
| what exactly does Program Verify Error at Program Address 0x000 mean | Gaston | Micro Controllers | 5 | 24th December 2006 06:17 PM |
| schematic & program to program pic 16f84a plz | mafiaaa | Micro Controllers | 2 | 27th November 2004 04:00 PM |
| Program Help | Timmymna | Micro Controllers | 3 | 15th March 2004 05:45 AM |
| Pic (A) program Pic (B) | NewCurrent | Micro Controllers | 0 | 3rd October 2003 04:13 PM |