LabVIEW for LEGO MINDSTORMS and LabVIEW for Education

cancel
Showing results for 
Search instead for 
Did you mean: 

Variables in LABVIEW for NXT

Solved!
Go to solution

Hi, I need to create a variable Subsequently That we can be changed and write to them new values. For example. I have left NXT Button, Which when pushed so I made some variable subtracted 20 and then added to the same variable, this value is then displayed on the NXT screen. But when you push the right button with this value is added to the value of 20 and entered again into the same variable. And this is repeated continuously. The current value is displayed on the screen of NXT. How do I solve? Through local variables?


Thank you for answering

0 Kudos
Message 1 of 3
(5,681 Views)
Solution
Accepted by topic author Noro

Hello!

 

What I would do is use a While Loop with a Shift Register and a case structure with three cases. One case is when the Left button is pressed, a second for the Right button, and the third for the case when nothing should happen. You should also make sure that it only increments once when the buttons are pressed, not increment while the button is pressed. Essentially Edge Triggering. 

Alex D
Systems Engineer
Academic Research
National Instruments
0 Kudos
Message 2 of 3
(5,659 Views)

Thank you so much, but my problem is solved. I solve this problem with local variables.

 

 

 

0 Kudos
Message 3 of 3
(5,652 Views)