RGB LED Component

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
User avatar
JohnCrow
Valued Contributor
Valued Contributor
Posts: 1367
Joined: Wed Sep 19, 2007 1:21 pm
Location: Lincolnshire
Contact:

RGB LED Component

Post by JohnCrow »

RBG Component (FC5)
Hi
I've been pulling my hair out trying to get the RGB component on hardware.
The Simulation is fine, but on hardware It always has 2 of the outputs high at any time.
Ive tried various configutations. Ive tried having the tick macro in the main loop and calling it as a seperate macro using various timer interupt settings.
But it still wont cycle the 3 basic colours.
RGB_Test_V1.fcf
(7 KiB) Downloaded 167 times
1 in 10 people understand binary, the other one doesn't !

User avatar
Jay Dee
Posts: 392
Joined: Tue Aug 18, 2009 6:42 pm
Contact:

Re: RGB LED Component

Post by Jay Dee »

Hi,
I ran it in V5 , using ECIO 40P and using an LED board, so 3 LEDs rather than the 3+common of an RGB. I got the same 'inverted' logic you saw.
Changed the polarity in the componet properties and got the expected bahaviour. But this I guess would only work with a common anode type RGB, I think :?
J.

User avatar
JohnCrow
Valued Contributor
Valued Contributor
Posts: 1367
Joined: Wed Sep 19, 2007 1:21 pm
Location: Lincolnshire
Contact:

Re: RGB LED Component

Post by JohnCrow »

Hi Jay Dee

I initally tried it with a comon cathode RGB LED.
I can get it to cycle correctly if I program it by setting the relevant port bits high or low, but not using the component.
I did try it using the LED e-block and got the same results, i.e. 2 leds on at once.

Just tried your suggestion and set it to active low, and its works :)
Just missed that setting.

Thanks
1 in 10 people understand binary, the other one doesn't !

User avatar
JohnCrow
Valued Contributor
Valued Contributor
Posts: 1367
Joined: Wed Sep 19, 2007 1:21 pm
Location: Lincolnshire
Contact:

Re: RGB LED Component

Post by JohnCrow »

it is possible to get it to work by calling the tick macro using TMR0 interupt as well
Ive attached a simple test program though the interupt time may need fine tuning to match the application.
RGB_Test_V2.fcf
TMR0 Tick
(13 KiB) Downloaded 237 times
1 in 10 people understand binary, the other one doesn't !

Post Reply