11-24-2012 08:19 PM
I have color boxes that I want to change color due to an decimal number input (64 bit) where I am getting numbers 0-1024
If I convert the number to hex they come out mostly black. Is there a way that I can have a sort of if/then thing going on that allocates each number to a certain color?
I would like to have a gradient fron red to blue that corresponds to the 0-1024 numbers
I attached the VI that I'm working with, its the bottom most part inside the while loop, I also attached the CSV txt file that goes with it
Thanks!
11-24-2012 08:49 PM - edited 11-24-2012 09:06 PM
Ok, I posted some code (deleted) before looking at the text file. Why are you using 64 bit integer?
Anyway, if you know the maximum value the sensor will provide, you can do something like this (using 16 bit integers):
11-25-2012 05:25 PM
Thanks so much!
This does work, even with the 64 biit. I'm not exactly sure why it's that way but I working on this as part of a group project and that is what some other guy gave me.
Is there a way to make it go through the green to? Like from blue to green to red?
Much appreciated.
11-25-2012 05:49 PM
Look at the help for the RGB to Color.vi and try a few things to see how they work. You have three inputs ranging from 0 to 255 to give you the total range of colors which cna be generated in LV. You need to decide how to map the values of your signal into those three color components.
Lynn