LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

led up down joystick controlled sequence

Hi all,


 

I am currently working on a Vi for a class project. I am using a joystick to interface with the Vi. It is basically a simulation of a vehicle with a speedo and rpm gauge that needs to shift up through the gears which are indicated by the LED's with one button and downshift with a different button. As the upshift button is pressed it turns on led and keeps it on. The I would like it to turn off led one and turn on led two when pressed again up to 5. The opposite for downshifting with a seperate button. I have gotten as far as to be able to latch in one led. I have made a small vi for just the led sequence part of it to post. It will however run in the while loop with all the other code once i have figured this out. 

 

I would greatly appreciate any guidance or tips anyone has. Thanks in advance. 

 


Running labview 8.6 and winxp

 

 

untitled.GIF

 

 

 

 

0 Kudos
Message 1 of 4
(3,077 Views)

I'm still hoping that there is a way to do it with just one button. In the meantime I have been working with using a different button for each led and latching it in even after the button reads false.

 

labview.GIF

0 Kudos
Message 2 of 4
(3,067 Views)

Instead of working with complicated boolean logic, store your current gear in a shift register as a number.  If the up button is pressed, it increments the value.  If the down button is pressed, it decrements the value.

 

Now turn your booleans into a boolean array.  Use the value of the shift register to determine which index value of the boolean array to turn on (and all the others would be off.)

Message 3 of 4
(3,064 Views)
Thank You very much! That sounds like a much easier way to go appraoch this.
0 Kudos
Message 4 of 4
(3,059 Views)