04-13-2017 10:33 AM
Hello, i am currently writing a code that takes a random current temperature and compares it to set values. Depending on the temperature, it will display a specific string warning. The problem that i am running into is the led portion. I want the led to light up a specific color based on the warning. (i.e. blue for freezing, red for heat, etc.) From reading other forums related to my problem, i have found that using the colors property node would probably work best, however after reading the help section i am a little confused on how to wire it. Could someone help me with this please? I have attached my code for reference. Thank you in advance.
Solved! Go to Solution.
04-13-2017 10:36 AM - edited 04-13-2017 10:39 AM
Instead of a LED, use a colorbox indicator. Here the color is the data. Works much better. (You can even make it look like an LED).
Have you looked at my VI in our earler discussion about the same thing?
04-13-2017 10:39 AM
i would try that but the assignment says to use an led specifically.
04-13-2017 10:43 AM - edited 04-13-2017 10:45 AM
It still does not explain why you are not using my code for the rest of the problem. Keep it simple! You can use the colorbox value from my code and wire it to your LED color property node, right?
To write to a property node, it needs to be in write mode. Currently yours are in read mode. Just right-click!
Ans since you are changing the LED color, it does not even need to be wired to the code, because the boolean value is irrelevant.
04-13-2017 10:54 AM - edited 04-13-2017 10:54 AM
Here is what I meant. Of course you should only write to the property node if the color value has actually just changed. Easy to do with a feedback node. Try it!
04-13-2017 11:01 AM
Im sorry for not trying that earlier, i must have just glanced over it last time i saw it. Ill go try that now. Really appreciate the help and quick reply. Thank you. Ill let you know how it goes.
04-13-2017 11:10 AM - edited 04-13-2017 11:13 AM
Note that in order to use "unbundle by name", you need to define labels for the cluster elements in the array constant. Else just use a plain unbundle operation.
Also, if you use any part of my code, you need to be able to fully explain it so make sure you understand the reason for every part.
04-13-2017 11:28 AM
I think i got it working, I did not end up adding the property node however. Thank you for your help once again. I have one question however, for the no warning string, i would like to make it between 32 and 75 (inclusive), and the high temp string between 75 and 100 (exclusice). The code currently does not do that. Is there a way to make it do that?
04-13-2017 12:46 PM
What's the digital resolution of the temperature measurement? Just tweak the boundaries accordingly.
04-13-2017 12:47 PM
how do i do that?