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

User avatar
JohnCrow
Valued Contributor
Valued Contributor
Posts: 1367
Joined: Wed Sep 19, 2007 1:21 pm
Location: Lincolnshire
Has thanked: 381 times
Been thanked: 715 times
Contact:

RGB LED Component

Postby JohnCrow » Sun Jan 22, 2012 5:43 pm

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 137 times
1 in 10 people understand binary, the other one doesn't !

User avatar
Jay Dee
Posts: 356
Joined: Tue Aug 18, 2009 6:42 pm
Has thanked: 116 times
Been thanked: 135 times
Contact:

Re: RGB LED Component

Postby Jay Dee » Sun Jan 22, 2012 7:49 pm

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.
These users thanked the author Jay Dee for the post:
JohnCrow (Sun Jan 22, 2012 8:18 pm)
Rating: 5.26%
 

User avatar
JohnCrow
Valued Contributor
Valued Contributor
Posts: 1367
Joined: Wed Sep 19, 2007 1:21 pm
Location: Lincolnshire
Has thanked: 381 times
Been thanked: 715 times
Contact:

Re: RGB LED Component

Postby JohnCrow » Sun Jan 22, 2012 8:22 pm

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
Has thanked: 381 times
Been thanked: 715 times
Contact:

Re: RGB LED Component

Postby JohnCrow » Sun Jan 22, 2012 9:07 pm

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 201 times
These users thanked the author JohnCrow for the post:
Benj (Mon Jan 23, 2012 11:22 am)
Rating: 5.26%
 
1 in 10 people understand binary, the other one doesn't !