View Single Post
  #2   Spotlight this post!  
Unread 16-02-2012, 11:49
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Running loop with button..

Don't put that in Teleop. The 3900 millisecond delay in there will bring everything else in the code to a halt, including the communication with the Driver Station, and the system watchdog will shut down the robot's outputs.

Do you know how to use the Flat Sequence structure? One of those in a neverending While loop placed in the Periodic Tasks vi is probably the right way to implement what you want. The first frame of the sequence will stop the motor and have a loop waiting for the button to be pressed. The second frame will run the motor and have a loop waiting for the limit switch. The third frame will reverse the motor and delay 3.9 seconds. If that's not enough of a hint, let me know.