LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

touch sensor

Hi,

 

not sure if im miss understanding you/ being a bit slow or if ive miss explained what im trying to do ( ive corrected what u explained) but I dont want to have to use the stop buttom to stop my sound. I wish to continue using the pressure sensor so that if i pressed/ bumped the pressure sensor again I would get another outcome. So far I have acheived playing another sound however it still plays the first sounda t the same time which isnt what I want at all. I have done the online tutorials and understand the basics and theory behind labview but I just cant seem to wrap my head around this for it to work :s

thanks

 

Tim 

0 Kudos
Message 11 of 13
(448 Views)

I must be missing something that your touch button VI is doing then.  The code you posted should wait for 50 mSec and then just stop.  It shouldn't make a sound unless you manage to press the sensor within the 50 mSec.  If it's running longer it must be the sensor VI waiting for a touch.

 

What you can do to follow the logic is to turn on execution highlighting (that's the little light bulb icon).  Turn it on and run the VI and you will see the values on the wires so you can see what the booleans going into the not equals VI are doing.  If the touch sensor VI is just monitoring the touch switch, the VI should keep on looping allowing you to see the values coming from it.  If it is waiting for you to touch the sensor, it will block the loop until you touch the sensor.  You can also right-click wires inside your VI and set a probe to watch the values.  Try it out and see if you can figure out where your logic isn't "sound".  (Ha)

 

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 12 of 13
(430 Views)

I think the issue is with the shift register and the 'not equals' function. The touch sensor is either in the pressed, or released condition. When it is not being pressed, both feeds into the not equals function are false so the requirements are not met, output is false and no sound is played. When the touch sensor gets pressed in the combination of the previouse shift register value of not being pressed in and the new condition of being pressed in meet the requirements  of the  not equals sign, case is true, therefore sound is played. But now the shift register has the previous value of touch sensor being pressed which means that when this is fed into the not equals function along with the  currentn not pressed in state of the touch sensor, it also meets the condition, case is true, and outputs a sound. Thus the sounds are getting played twice every time I press the button.

 

So i know why its happening, but I dont know how to fix it, or move on to what I really want it to do which is depending on how manny times I press the buttons it will give a different musical output

 

Cheers

 

Tim

0 Kudos
Message 13 of 13
(428 Views)