Thread: Questions?"?
View Single Post
  #4   Spotlight this post!  
Unread 23-02-2016, 09:40
cjl2625's Avatar
cjl2625 cjl2625 is offline
apel py
AKA: Cory Lynch
FRC #2067 (Apple Pi)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2013
Location: Guilford, CT
Posts: 412
cjl2625 is a splendid one to beholdcjl2625 is a splendid one to beholdcjl2625 is a splendid one to beholdcjl2625 is a splendid one to beholdcjl2625 is a splendid one to beholdcjl2625 is a splendid one to beholdcjl2625 is a splendid one to beholdcjl2625 is a splendid one to behold
Re: Questions?"?

Here's a mockup of how I do toggle, as in push a button once to turn on, and push again to turn off. (Don't have access to real labview right now)
http://put.nu/files/yfTgg-h.jpg
Not sure if there's a more compact way, but this works. (The blocks with arrows are feedback nodes, and the thing on the left is the button input)
Since the feedback node stores information from a previous iteration, the first part says "button is currently pressed AND last iteration it wasn't," meaning the button was just pushed.
The exclusive or part causes it to flip between true and false when the button is pressed, due to its "either but not both" behavior.

Not sure what your second question is, but you can make a motor go forward by supplying a positive output value, and backwards with a negative output value. Switch between values with a case structure or select block.
__________________
Head Programmer / Driver

Last edited by cjl2625 : 23-02-2016 at 09:54.