loading
 
Multiple Sample Color Modules
siu hap meng from Malaysia  [3 posts]
7 months
How do I use more than one Sample_Color module in one image? I was able to put those modules in the pipeline, but the problem is all the modules use the same variable which is "COLOR_SAMPLE". This creates conflict to the variable where only the last module is referenced, not each of them. I tried to use Set Variable module to change the variable name using Set Variable module but no success. Please help me. Thanks!
STeven from United States  [1403 posts] 2 months
You are correct in your usage of the Set_Variable module. That would be the way to "rename" a variable to another name such that the value is not overwritten. You must be sure, however, to use the correct expression in the Set_Variable module to do this. For example, in the Sample_Color module the variable COLOR_SAMPLE_R is create. In Set_Variable you would use

new_r [COLOR_SAMPLE_R]

but NOT select the IsArray checkbox ... that's only for when you specify a list of values in a comma separated list that you want converted into an array.

See attached example.

STeven.



program.robo

 Reply  New Post   Forum Index