01-29-2013 08:08 AM
I'm trying to set up a code so that when a button is pushed (boolean turns true), the following happens:
1) Send a value of -1 to a window motor
2) Wait 0.25 seconds
3) Send a value of 1 to the same motor
4) Wait 0.25 seconds
5) Send a value of 0 to the same motor
However I want this to happen all the way through, whether the boolean turns back false or not, and if I hold down the button, it only runs once. I know how to put delays in STRUCTURES like loops and Case Structures, but outside of any of those, I have no idea.
01-29-2013 08:14 AM - edited 01-29-2013 08:15 AM
01-29-2013 08:37 AM
That looks perfect, thank you ^^ How do I set a button to Latch When Pressed? I tried Properties, but it only shows the attached (went ahead and included a pic of my code too)
01-29-2013 08:55 AM
Hi Animus,
when you say "button" you should have noted you're talking about some hardware dangling aside your PC...
In that case you should use a shift register to hold the previous state of your button and compare that with the current state to generate the TRUE signal for the case structure. (That's usually called "rising edge detection"!)