Multiple LED Blinking Fading Effect.

FYP Starter Pack, ICs, Voltage Regulator, Resistor, Capacitor......

Re: Multiple LED Blinking Fading Effect.

Postby Brian Griffin » Thu Jun 30, 2011 11:06 pm

roywnc69 WROTE:Thnxx Brian for your kind replies. Actually i have tried many of the led fading that been search form the internet. I have follow thier diagram,but seems it not working. For single led,yes its work. But when tried to run 2 led, its failed. For your perusal i attach herewith my project that i working on.
http://www.facebook.com/photo.php?fbid=109890672435632&set=a.102286166529416.4797.100002440988495&type=1&theater
[url]http://www.facebook.com/photo.php?fbid=109282475829785&set=a.102286166529416.4797.100002440988495&type=1&theater]
[/url]
Blinking is not suitable for my project, that's why i need ' fading effect '. thanxx again for your help. :)


You should know not everybody has a facebook account. You can post a picture here? There are attachments section. Thanks.
PIC - UIC00B from Cytron (replacement for my broken PICKit 2), Pickit 3, MikroC for PIC
dsPIC - MikroC for dsPIC, mikromedia board (dsPIC33)
AVR - AVR Dragon
Parallax - Prop tool
User avatar
Brian Griffin
Enthusiast
 
Posts: 403
Joined: Mon Jan 17, 2011 9:36 am

Re: Multiple LED Blinking Fading Effect.

Postby aurora » Fri Jul 01, 2011 1:12 am

Say:
SET 1 - Orange (4 LED)
SET 2 - Orange (4 LED)
SET 3 - Blue (3 LED)
SET 4 - Blue (3 LED)

If you just want fade between this 2 colour, means you only need 2 PWM. Assign 1 PWM channel for orange, and another channel for blue.

Or you can try something like this, note that this is just example for fading of one channel. You need to crack your head a bit to write it for multiple channels.
CODE: SELECT_ALL_CODE
for(orange=0;orange<255;orange++)
{
output_high;
count = 255;
while(count>orange)
{     delay_us(20);
      count--;
}

output_low;
count = 0;
while(count<orange)
{     delay_us(20);
      count++;
}


p.s.: Brian please register a facebook account. ;)
aurora
Discoverer
 
Posts: 126
Joined: Sun Jun 07, 2009 4:52 pm

Re: Multiple LED Blinking Fading Effect.

Postby Brian Griffin » Fri Jul 01, 2011 11:18 am

aurora WROTE:p.s.: Brian please register a facebook account. ;)


lol, I will.

By the way, another method to do a multi-channel PWM is using a round-robin fashion multitasking. However, it gives timing issues especially in more channels.
PIC - UIC00B from Cytron (replacement for my broken PICKit 2), Pickit 3, MikroC for PIC
dsPIC - MikroC for dsPIC, mikromedia board (dsPIC33)
AVR - AVR Dragon
Parallax - Prop tool
User avatar
Brian Griffin
Enthusiast
 
Posts: 403
Joined: Mon Jan 17, 2011 9:36 am

Previous

Return to Electronic Component

Who is online

Users browsing this forum: No registered users and 9 guests

cron