Page 1 of 1

color sensor issue with "GetFrequency" Flowcode 6

Posted: Mon Dec 11, 2017 7:46 pm
by BatmanSterling
Hi everyone,


I'm using the color-sensor EMB018 in Flowcode 6.
I created almost the same programm as the example in the help page : http://www.matrixtsl.com/wiki/index.php ... s:_Sensors)
But I have a problem ; I have an issue of results at the step of "GetFrequency". If you watch the example programm, the RGB values are collected and disp on the LCD, but in mine the sensor isn't able to get the frequency of the red, blue and green after put the filter of each color.
I don't know if my issue is because of my connecting on the pins, or if the color objet has to be link with the sensor...
I join my programm if someone would kindly help me...

//First in the programm the switch in front of the purple led has to be activate. Then the issue is in the macro "TestViolet".
Programme TCS.fcfx
(18.42 KiB) Downloaded 455 times


I'm sorry for the second post, now that i found where to create a new topic. I'm sorry for my english by the way ;)
Thanks a lot.
BatmanSterling.

Re: color sensor issue with "GetFrequency" Flowcode 6

Posted: Tue Dec 12, 2017 11:28 am
by LeighM
Hi,
It looks like the simulation is not working, we will check this out.
Do you have this working on hardware?

Re: color sensor issue with "GetFrequency" Flowcode 6

Posted: Tue Dec 12, 2017 3:50 pm
by BatmanSterling
Hey,
Thanks for the answer
If I've well understood your answer, on my computer the simulation works, but at the step "getfrequency" which take the frequency of red, green and blue, the programme crashes and it is written : "Results Mistakes".
I joined a file with my programm.
Did I well answer your question ?
Thanks

Re: color sensor issue with "GetFrequency" Flowcode 6

Posted: Wed Dec 13, 2017 6:35 pm
by Benj
Hello,

I believe I have found the problem now. Please can you test the new component and check it solves the problem for you.

Simply copy the attached file to your "Flowcode 6/components" directory and restart Flowcode.
EBM018_ColourSensor.fcpx
(785.35 KiB) Downloaded 495 times
Let us know how you get on.

Re: color sensor issue with "GetFrequency" Flowcode 6

Posted: Wed Dec 13, 2017 6:56 pm
by BatmanSterling
Hello,

Thanks a lot, it works perfectly now. I really thank you for your time and you answer ! :)
But how did you know that it was the problem ?
Thanks again to all who replied me ;)

Re: color sensor issue with "GetFrequency" Flowcode 6

Posted: Wed Dec 13, 2017 7:52 pm
by Benj
Thanks for the fast reply, much appreciated.

The problem was down to the order the components were added to the project.

The Flowcode panels are a tree like structure. For example.

Root (dashboard and 3D)
-Component1
--Comp1 Object1
--Comp1 Object2
-Component2
--Comp2 Object1
....

The component detects for collisions with other panel items and then scans for the component name to get a handle to reference the colour.

The collision was ok but when scanning for the component name it was missing the component because the scan was ending at the colour sensor.

e.g. this would work

Root (dashboard and 3D)
-Shape1
-ColourSensor

but this would fail.

Root (dashboard and 3D)
-ColourSensor
-Shape1

Now the scan covers all panel items.

Re: color sensor issue with "GetFrequency" Flowcode 6

Posted: Wed Dec 13, 2017 8:56 pm
by BatmanSterling
Ok, thanks again :)