View Single Post
  #13   Spotlight this post!  
Unread 06-09-2009, 16:37
byteit101's Avatar
byteit101 byteit101 is offline
WPILib maintainer (WPI)
AKA: Patrick Plenefisch
no team (The Cat Attack (Formerly))
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Worcester
Posts: 699
byteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of light
Re: very basic code help

Quote:
Originally Posted by mikelowry View Post
Code:
while (IsOperatorControl()) 
			{
				GetWatchdog().Feed();
				myRobot.TankDrive(leftStick, rightStick);
				Wait(0.005);
			}
Is the while(IsOperatorControl()) line really necessary? because all of the code inside it is inside the teleop section of the code anyway.

And what is the difference between putting the RobotDrive and the Joysticks inside the class and moving the constructors as opposed to how i had it?
Yes, but remove the while(1) around that, because if you dont, it will do it once and exit. the function is called and not called again untill it switches state, so if it stays there, then your program stays there
__________________
Bubble Wrap: programmers rewards
Watchdog.Kill();
printf("Watchdog is Dead, Celebrate!");
How to make a self aware robot: while (∞) cout<<(sqrt(-∞)/-0);
Previously FRC 451 (The Cat Attack)
Now part of the class of 2016 at WPI & helping on WPILib
Reply With Quote