03-18-2020 02:47 AM
Hello Engineers,
I am new to Labview, so please be patient with me 🙂
In this project, I am using one switch to turn LED On/Off.
I want to keep the LED On with one press and stays On when I release the switch, but when I press the switch the second time, I want the LED to turn off and stays off.
I did the design, but the only way that I could do it with is using for loop with specific length (the length of the for loop such as 10 iterations) when the case structure is true.
I attached the file and picture of the hardware which is only one switch and one LED.
Any improving idea would be appreciate it.
Thank you in advance
Solved! Go to Solution.
03-18-2020 11:12 AM
A FOR loop that runs as fast as it can is not a timing device in any form. Look in the timing palette instead.
You probably only need to write to a Digital Write port when the value changes. No need to write the same value over and over.
Your code makes little sense. I would recommend to do a few more tutorials, look at the shipping examples, and then design it all as a simple state machine.
03-18-2020 11:22 AM
03-18-2020 09:38 PM
Thank you so much altenbach, this is just what I am looking for.
Could you please explain how dose this Vi work ?
Really appreciate it
03-18-2020 10:43 PM
@Eisa_Alyaqoub wrote:Could you please explain how dose this Vi work ?
There's not much to explain. You can right-click any element and launch the help. Place probes and run in execution highlighting to watch what happens. Do you understand some of it? Do you have a specific question?