View Single Post
  #1   Spotlight this post!  
Unread 03-02-2013, 11:51
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,833
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Relay and window motor

Here is a sample multi-button sequence that goes in Periodic Tasks.vi (NOT Teleop.vi, because of the delays).
The sequences for each button are independent although Button 1 goes first if both buttons are pressed simultaneously.

However, the possibility of the wrong button being pushed must be handled.
What happens if button 1 is pushed twice in a row?
You can add a check that only allows the proper button to be pushed. That's called a state machine.
That might also be handled by adding a limit switch at the bottom as feedback for when it's all the way down, and maybe another to prevent it from going too far up. A limit switch check would then simply replace the timer at the beginning of each of the sequences.

For Opening Relays, if you can get one Open successfully coded, then you can highlight all of it , then copy/paste to get the next one.
Then use the cursor to select a different Relay number.
Attached Thumbnails
Click image for larger version

Name:	Multi-button-sequences.png
Views:	123
Size:	52.5 KB
ID:	13775  
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 03-02-2013 at 21:37.
Reply With Quote