Flowing RGB LED example

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 5.
To post in this forum you must have a registered copy of Flowcode 5 or higher.

Moderator: Benj

Post Reply
benrouse77
Posts: 26
Joined: Thu Jul 05, 2012 11:29 pm
Has thanked: 12 times
Been thanked: 1 time

Flowing RGB LED example

Post 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.

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times

Re: Flowing RGB LED example

Post by Enamul »

Enamul
University of Nottingham
enamul4mm@gmail.com

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Flowing RGB LED example

Post 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.
Attachments
RGBLED.fcf
(10 KiB) Downloaded 470 times

benrouse77
Posts: 26
Joined: Thu Jul 05, 2012 11:29 pm
Has thanked: 12 times
Been thanked: 1 time

Re: Flowing RGB LED example

Post 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
Attachments
rgb glow.fcf_avr
(21.06 KiB) Downloaded 367 times

benrouse77
Posts: 26
Joined: Thu Jul 05, 2012 11:29 pm
Has thanked: 12 times
Been thanked: 1 time

Re: Flowing RGB LED example

Post 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
Attachments
rgb glow pwm.fcf_avr
(26.15 KiB) Downloaded 396 times

dazz
Posts: 1314
Joined: Sun Jan 15, 2012 3:15 pm
Has thanked: 474 times
Been thanked: 458 times

Re: Flowing RGB LED example

Post 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
To sign up to the V5 forum follow this link http://www.matrixmultimedia.com/forum_upgrades.php

dazz
Posts: 1314
Joined: Sun Jan 15, 2012 3:15 pm
Has thanked: 474 times
Been thanked: 458 times

Re: Flowing RGB LED example

Post 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
Arduino Mega ADK 2560 pwm.fcd
(21.78 KiB) Downloaded 387 times
1.jpg
1.jpg (135.89 KiB) Viewed 7955 times
Arduino Mega ADK 2560 pwm.fcd
(21.78 KiB) Downloaded 387 times
Attachments
2.jpg
2.jpg (105.48 KiB) Viewed 7955 times
To sign up to the V5 forum follow this link http://www.matrixmultimedia.com/forum_upgrades.php

benrouse77
Posts: 26
Joined: Thu Jul 05, 2012 11:29 pm
Has thanked: 12 times
Been thanked: 1 time

Re: Flowing RGB LED example

Post by benrouse77 »

Thanks dazz, it's help like this is why I'm loving this forum!!

Ben

Post Reply