Page 1 of 1
Flowing RGB LED example
Posted: Sat Jul 14, 2012 11:48 pm
by benrouse77
Hi guys, anyone done a flowing RGB LED example? changing through all colours to white in a glowing type pattern? I've started one but didn't realise how long it would take to get a nice flowing one.
Re: Flowing RGB LED example
Posted: Sun Jul 15, 2012 11:52 am
by Enamul
Re: Flowing RGB LED example
Posted: Mon Jul 16, 2012 5:25 pm
by Benj
Hello,
The easiest way to get every single combination of colours is to create a loop with 3 nested incrementing variables each controlling a colour channel.
Re: Flowing RGB LED example
Posted: Mon Jul 16, 2012 10:33 pm
by benrouse77
Thanks Benj this is just what I needed. have bodged up a file to give a rainbow from the RGB led. I'm sure it's to long winded but it works to a sort. Delay macro is the speed of the glow and delay2 is the pause at the end of each colour.
It starts blue to go to white but after the 1st round it all works. please feel free to add to it or re do if it's a load of rubbish.
Ben
Re: Flowing RGB LED example
Posted: Tue Jul 17, 2012 10:43 am
by benrouse77
Have made an example for people who have the home /student version with no RGB complile feature using PWM.
The chip is using an arduino mega adk but can be change for any chip. led pins are 13,11,4 (not sure why if anyone can tell me how to know what my PWM pins are on my arduino) again the delay macro controlls speed and the delay2 controls the pause at the end of the colour glow.
Feel free people to download and use as you like. I may redo it to tidy it up but it's working. (still has RGB component but it won't compile unless you have the pro v5)
Can anyone tell me if the previous file works with v5 pro?
Ben
Re: Flowing RGB LED example
Posted: Tue Jul 17, 2012 11:10 am
by dazz
Hi ben
In the chip view it lists the pwm pins and thier corresponding arduino d pins give me an hour or so and i will pop up a modified fcd with shows the pwm numbers ie pwm1 etc
Re: Flowing RGB LED example
Posted: Tue Jul 17, 2012 11:44 am
by dazz
Hi ben
attached is a modified fcd ,a and 2 pic which show the extra bits added to the chip view, you will also notice that there an extra 2 pwm's in flowcode (15 and 16)
copy the fcd file attached into your flowcode fcd folder, dont rename it just yet, restart flowcode and select the new chip (mega 2560 adk pwm) as your target then in the chip view you will see that the pwm pins have thier corresponding chanels added ie pwm1 pwm2 etc
first pic shows the chip view with the normal fcd, and pic 2 shows the new one , have a look at the black circle hope it helps
Regards
Dazz

- 1.jpg (135.89 KiB) Viewed 8311 times
Re: Flowing RGB LED example
Posted: Tue Jul 17, 2012 11:52 am
by benrouse77
Thanks dazz, it's help like this is why I'm loving this forum!!
Ben