View Single Post
  #5   Spotlight this post!  
Unread 04-09-2009, 13:44
mikelowry mikelowry is offline
Registered User
FRC #1771 (N.G.R.)
Team Role: Engineer
 
Join Date: Mar 2009
Rookie Year: 2009
Location: Suwanee GA
Posts: 63
mikelowry is a name known to allmikelowry is a name known to allmikelowry is a name known to allmikelowry is a name known to allmikelowry is a name known to allmikelowry is a name known to all
Re: very basic code help

Thanks for all the help so far. One more question.
We are using the simple robot template, and as far as I can tell, everything is right, but it wont build.

Code:
#include "WPILib.h"

RobotDrive myRobot(1,2);
Joystick leftStick(1);
Joystick rightStick(2);
class RobotDemo : public SimpleRobot 
{
	RobotDemo(void)
	{
		GetWatchdog().SetEnabled(false);
	}

	void Autonomous(void) 
	{
		GetWatchdog().SetEnabled(false);
		while(1)
		{
			for(int i = 0; i < 4; i++)
			{
				myRobot.TankDrive(0.5,-0.5);
				Wait(4);
				myRobot.TankDrive(0.5,0.5);
				Wait(2);
			}
			myRobot.TankDrive(0.0,0.0);
			Wait(4);
		}
	}
	
	void OperatorControl(void) 
	{
		while(1)
		{
			GetWatchdog().SetEnabled(false);
			while (IsOperatorControl()) 
			{
				myRobot.TankDrive(leftStick, rightStick);
				Wait(0.005);
			}
		}
	}
};
START_ROBOT_CLASS(RobotDemo);
we get the following errors at build:
"RobotDemo::RobotDemo()' is private" in reference to line 7
and
a nonspecific error at the very last line.

Can you tell what I need to do to fix it?
__________________


2008 Xerox Creativity Award - Championships
2009 Rockwell Automation Innovation in Control award - Peachtree
2009 GM Industrial Design Award - Palmetto
2009 Palmetto Champions <1771 2415 21>
Reply With Quote