View Single Post
  #5   Spotlight this post!  
Unread 20-01-2015, 03:23
Peter Johnson Peter Johnson is offline
WPILib Developer
FRC #0294 (Beach Cities Robotics)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Redondo Beach, CA
Posts: 264
Peter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud ofPeter Johnson has much to be proud of
Re: What is wrong with my RobotPy code?

There are two issues with your code:

1 - you call teleopPeriodic from robotInit. You shouldn't do this. The IterativeRobot class does this for you.

2 - you have a while loop in teleopPeriodic. You shouldn't do this either. The IterativeRobot class periodically calls this function in a loop. You only need to have a while loop if you're using SampleRobot as a base class (not recommended).

See the documentation on IterativeRobot for more details: http://robotpy.readthedocs.org/en/la...tiveRobot.html
__________________
Author of cscore - WPILib CameraServer for 2017+
Author of ntcore - WPILib NetworkTables for 2016+
Creator of RobotPy - Python for FRC

2010 FRC World Champions (294, 67, 177)
2007 FTC World Champions (30, 74, 23)
2001 FRC National Champions (71, 294, 125, 365, 279)