11-26-2012 02:03 PM
Hey everybody,
I'm trying to make an LED indicator that is hooked up to a scale. The scale will always read between 0 and 20lbs. What I need this LED to do is start off blue or green. Around 10lbs it needs to gradually fade to yellow, and at 20 it should do the same thing but to red.
I've tried using a color box with a case structure and also a picture wheel, but all I can come up with is hard color changes from one to the other. The fading between colors is what's killing me.
Any suggestions are very much appreciated.
Solved! Go to Solution.
11-26-2012 02:38 PM
I guess the boolean (LED) adds a little flair with the specular reflection so here is one way to do it.
11-26-2012 02:43 PM
That's absolutely perfect! Thank you so much.
Also, today I learned that the VI Snippet also allows event structures to work. That's really impressive. How do they get something that has multiple cases to come through in the PNG file?
11-26-2012 02:50 PM
Actually the built-in snippet creator mangles Event structures (and property nodes) so I used my own home-cooked version to create that Snippet. You should search for and use the Code Capture Tool, it will help a lot.
11-26-2012 03:29 PM
Have you considered a Color Ramp instead? Or using the ramp on a Dial, Meter, or Gauge?
11-26-2012 05:08 PM
@Darin.K wrote:
I guess the boolean (LED) adds a little flair with the specular reflection so here is one way to do it.
... or you could simply create a colorbox that looks like an LED. See the three links in my idea here.
Spectacularly specular! 😄
11-27-2012 12:41 AM
@Matub wrote:
How do they get something that has multiple cases to come through in the PNG file?
Basically, the PNG format allows adding custom data to the file, which isn't shown when you view the image. LV basically takes the selected code and saves it into the file and then later extracts it. It looks as if NI used the same function used for creating subVIs to do this, which is why property nodes and event structures don't come out nicely, but as Darin pointed out, the Code Capture Tool will let you get snippets which look good (as well as having a few other nice features).
11-28-2012 06:37 AM
Hey is it possible to get this VI. ???
11-28-2012 08:11 AM
Do you mean the VI for the picture Darin.K posted? What you do for that is save the picture he posted, find the file, and drag it into a blank VI. The code will automatically appear.
11-29-2012 05:52 AM
Hey Its awesome..I never knew that its possible by drag and drop in blank VI...
Thanks,
Kumar