View Single Post
  #1   Spotlight this post!  
Unread 27-01-2013, 21:44
jhellr13 jhellr13 is offline
Registered User
FRC #4272
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: US
Posts: 187
jhellr13 is an unknown quantity at this point
Moving autonomous programs to teleop

I am looking for some help with automating some tasks in teleop by using code from autonomous.

For example, lets say I have an autonomous mode where the first while loop is to drive straight using encoders for a certain distance, then move to another loop where the robot turns in a circle using the encoders, and then moves to a while loop where the motors are stopped.

Now lets say that I want to use that code during teleop if i press a button. Do I just copy the code from autonomous and place it in a case structure attached to the button in teleop? Does it have to go in periodic tasks instead? Does each while loop have to be in a flat sequence as well?

Help please? Thanks
Reply With Quote