Page 2 of 2

Re: Multiple LED Blinking Fading Effect.

PostPosted: Thu Jun 30, 2011 11:06 pm
by Brian Griffin
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.

Re: Multiple LED Blinking Fading Effect.

PostPosted: Fri Jul 01, 2011 1:12 am
by aurora
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. ;)

Re: Multiple LED Blinking Fading Effect.

PostPosted: Fri Jul 01, 2011 11:18 am
by Brian Griffin
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.