View Single Post
  #3   Spotlight this post!  
Unread 27-01-2013, 21:54
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
Re: Moving autonomous programs to teleop

Quote:
Originally Posted by Greg McKaskle View Post
TeleOp is designed to return to the scheduler and be called again every 20ms. If you put code there that takes longer than 20ms to run, it will cause the robot to miss joystick values. I'd recommend putting the code into Periodic tasks and using a global to cause it to start and stop when appropriate, auto or teleop.

Greg McKaskle
Thanks! I'll try that tomorrow. Could you elaborate on what you mean by using a global? Do you mean make a global boolean variable in teleop to check if the button is pressed, then read the global in periodic tasks and perform the action?
Reply With Quote