Go to Post If you want to grow the program such that every student on the planet has the chance to participate, you have to start THINKING with a world-centric mindset. - Racer26 [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 02-09-2009, 21:25
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
very basic code help

Team 1771's only programmer last year was a senior, and now he is gone. Myself and one other teammate are trying to learn how to program in time for next season.

We just got windriver installed on our team laptop and are still figuring out how to use it. No one on our team currently knows how to use it.

We both have very basic C++ skills.

We downloaded the basic starter code supplied by FIRST.

We can currently do teleop tank drive with 2 joysticks and an autonomous that goes straight forward without stopping.

Can anyone point me toward some resources for learning about windriver and about controlling basic functions of the robot, or just walk me through?
__________________


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
  #2   Spotlight this post!  
Unread 03-09-2009, 00:51
EHaskins EHaskins is offline
Needs to change his user title.
AKA: Eric Haskins
no team (CARD #6 (SCOE))
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Elkhorn, WI USA
Posts: 998
EHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond repute
Send a message via MSN to EHaskins
Re: very basic code help

The FRC C/C++ Users Guide is a good starting point. It should be included in the windriver install (IIRC, c:\windriver\docs\), otherwise it should be available from http://usfirst.org/roboticsprograms/....aspx?id=14532.

Start there then when you have specific issues/question come back and I'm sure someone here will help.
__________________
Eric Haskins KC9JVH
Reply With Quote
  #3   Spotlight this post!  
Unread 03-09-2009, 12:35
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 the help, but now we have a more specific question.

We are experimenting with autonomous and we have this code


Code:
void Autonomous(void) 
{
	GetWatchdog().SetEnabled(false);
	myRobot.Drive(0.5,0.5);
}

we dont really know what GetWatchdog is, we know that the sample code has it.

What we have so far makes it drive straight at half speed indefinitely as far as we can tell. We looked at RobotDrive.cpp and .h in the WPILib but we cant figure out how to end the .drive command and move on to the next line.
__________________


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
  #4   Spotlight this post!  
Unread 03-09-2009, 13:38
EHaskins EHaskins is offline
Needs to change his user title.
AKA: Eric Haskins
no team (CARD #6 (SCOE))
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Elkhorn, WI USA
Posts: 998
EHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond repute
Send a message via MSN to EHaskins
Re: very basic code help

NOTE: Some of the function/class/template names have changed since I began working with this, so I may accidentally use a old name.
Quote:
Originally Posted by mikelowry View Post
Thanks for the help, but now we have a more specific question.

We are experimenting with autonomous and we have this code


Code:
void Autonomous(void) 
{
	GetWatchdog().SetEnabled(false);
	myRobot.Drive(0.5,0.5);
}

we dont really know what GetWatchdog is, we know that the sample code has it.

What we have so far makes it drive straight at half speed indefinitely as far as we can tell. We looked at RobotDrive.cpp and .h in the WPILib but we cant figure out how to end the .drive command and move on to the next line.
The watchdog is a safety feature. When enabled, you call Feed(Timeout) where Timeout is the amount of time before the robot will be disabled. If you call Feed again within the timeout period the robot continues normally. If you don't all outputs are disabled.

When you are debugging you will often disable the watchdog.

The myRobot.Drive() function sets a speed, and continues at that speed until told otherwise.

If you are using the Simple robot template you just insert a delay (I believe there is a Wait() function in there somewhere), then call Drive again.

If you are using the Itterative robot template you have a little more work todo. Essentially you would create a state machine using the number of itterations and/or sensor inputs to move between states (forward until hit wall, left turn 90 degree, ect.).
__________________
Eric Haskins KC9JVH
Reply With Quote
  #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
  #6   Spotlight this post!  
Unread 04-09-2009, 14:06
Jared Russell's Avatar
Jared Russell Jared Russell is offline
Taking a year (mostly) off
FRC #0254 (The Cheesy Poofs), FRC #0341 (Miss Daisy)
Team Role: Engineer
 
Join Date: Nov 2002
Rookie Year: 2001
Location: San Francisco, CA
Posts: 3,078
Jared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond repute
Thumbs up Re: very basic code help

Quote:
Originally Posted by mikelowry View Post
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?
Your compiler is complaining because the START_ROBOT_CLASS macro attempts to instantiate an instance of your RobotDemo class. In order to instantiate a class, the class' constructor is called. You have a constructor for your RobotDemo class, but it is declared "private" by default. This means that outside entities (like the START_ROBOT_CLASS macro) cannot call the constructor, hence the error you are seeing. To fix the behavior, your constructor (and all of the other functions required to implement a SimpleRobot, like Autonomous and OperatorControl) need to be declared as "public".

To do this:

Code:
class RobotDemo : public SimpleRobot 
{
public:
	RobotDemo(void)
	{
		...
	};

        ... the rest of your functions here
};
START_ROBOT_CLASS(RobotDemo);
I believe that's the only error that prevents this code from compiling (although without trying to compile it myself I may have missed something).

Last edited by Jared Russell : 04-09-2009 at 14:09.
Reply With Quote
  #7   Spotlight this post!  
Unread 04-09-2009, 15:03
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

Oh ok, thanks. I saw that when i was reading a fragment of last years code that was left on the desktop of the laptop we use, but i didnt think we needed it because it wasn't included in the FIRST supplied code.
I cant test it now because im at home, but im pretty sure it will work.
thanks.
__________________


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
  #8   Spotlight this post!  
Unread 04-09-2009, 15:07
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
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?
you should also put the Joystics and RobotDrive inside the class (and move the constructors for them, you SHOULD use the watchdog (unless debugging), and you have infinite loops (and auto is longer than 15 seconds, but i am assuming it is not for a real competition):
Code:
#include "WPILib.h"

class RobotDemo : public SimpleRobot 
{

RobotDrive myRobot;
Joystick leftStick;
Joystick rightStick;
public:
	RobotDemo():myRobot(1,2), leftStick(1), rightStick(2)//need to put them here
	{
		//GetWatchdog().SetEnabled(false); dont need to do this here
	}

	void Autonomous() 
	{
		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() 
	{
		//while(1) and you should use while(true) in C++, while(1) is so C
		//{
			GetWatchdog().SetEnabled(true);
			while (IsOperatorControl()) 
			{
				GetWatchdog().Feed();
				myRobot.TankDrive(leftStick, rightStick);
				Wait(0.005);
			}
		//}
	}
};
START_ROBOT_CLASS(RobotDemo);
__________________
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
  #9   Spotlight this post!  
Unread 04-09-2009, 15:15
Jared Russell's Avatar
Jared Russell Jared Russell is offline
Taking a year (mostly) off
FRC #0254 (The Cheesy Poofs), FRC #0341 (Miss Daisy)
Team Role: Engineer
 
Join Date: Nov 2002
Rookie Year: 2001
Location: San Francisco, CA
Posts: 3,078
Jared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond repute
Re: very basic code help

Quote:
Originally Posted by byteit101 View Post
you should also put the Joystics and RobotDrive inside the class (and move the constructors for them, you SHOULD use the watchdog (unless debugging), and you have infinite loops (and auto is longer than 15 seconds, but i am assuming it is not for a real competition):
Code:
#include "WPILib.h"

class RobotDemo : public SimpleRobot 
{

RobotDrive myRobot;
Joystick leftStick;
Joystick rightStick;
public:
	RobotDemo():myRobot(1,2), leftStick(1), rightStick(2)//need to put them here
	{
		//GetWatchdog().SetEnabled(false); dont need to do this here
	}

	void Autonomous() 
	{
		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() 
	{
		//while(1) and you should use while(true) in C++, while(1) is so C
		//{
			GetWatchdog().SetEnabled(true);
			while (IsOperatorControl()) 
			{
				GetWatchdog().Feed();
				myRobot.TankDrive(leftStick, rightStick);
				Wait(0.005);
			}
		//}
	}
};
START_ROBOT_CLASS(RobotDemo);
Just so nobody gets confused, while these suggestions are certainly reflective of good practice and may reflect the actual coder's intent, they aren't strictly necessary for your code to compile and work (work as in not crash as opposed to exactly what you want it to do).
Reply With Quote
  #10   Spotlight this post!  
Unread 04-09-2009, 17:39
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

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?
__________________


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>

Last edited by mikelowry : 04-09-2009 at 17:48.
Reply With Quote
  #11   Spotlight this post!  
Unread 04-09-2009, 17:43
nighterfighter nighterfighter is offline
1771 Alum, 1771 Mentor
AKA: Matt B
FRC #1771 (1771)
Team Role: Mentor
 
Join Date: Sep 2009
Rookie Year: 2007
Location: Suwanee/Kennesaw, GA
Posts: 835
nighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant future
Re: very basic code help

Hey, I am the other programmer working on this.

We have another problem also.

During our tele-op period, it runs our autonomous code!

Any idea as to why this could be?

At first it worked fine, then when we ran it again, it started doing autonomous in teleop, and wouldn't accept any input from us.

I changed the battery and did a power cycle, and that fixed it; once. After I ran it again in teleop, it went back to doing autonomous.

Any idea?
Reply With Quote
  #12   Spotlight this post!  
Unread 06-09-2009, 10:25
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

you need to remove the infinite loops, the while(1) like i said above
__________________
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
  #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
  #14   Spotlight this post!  
Unread 06-09-2009, 17:32
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

Ok, thank you.

But what about the constructors for the Joystick and RobotDrive? Why does it make a difference wether or not they are inside the class. It compiles fine either way.
__________________


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
  #15   Spotlight this post!  
Unread 06-09-2009, 17:44
EHaskins EHaskins is offline
Needs to change his user title.
AKA: Eric Haskins
no team (CARD #6 (SCOE))
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Elkhorn, WI USA
Posts: 998
EHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond repute
Send a message via MSN to EHaskins
Re: very basic code help

Quote:
Originally Posted by mikelowry View Post
Ok, thank you.

But what about the constructors for the Joystick and RobotDrive? Why does it make a difference wether or not they are inside the class. It compiles fine either way.
In general, it is best practice to encapsulate the state of a class (i.e. the joysticks and RobotDrive) within the class. This allows you to create multiple instances of the class safely.

It also makes it easier to debug and modify since if they are contained within the class no other objects have direct access to them.

In this case it shouldn't matter since you should only ever have a single instance of the robot class. However it is still best practice.
__________________
Eric Haskins KC9JVH
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
High CPU Usage in LabVIEW even with Basic Code Elliot Swart Programming 5 28-01-2009 08:44
Basic Math Help CoasterFuelPhil Programming 21 23-02-2007 21:30
Help programming in Visual Basic xxlshortys Programming 0 06-04-2003 08:54
Very Basic Programming Question kewlkid382 Chit-Chat 5 18-01-2003 11:11


All times are GMT -5. The time now is 03:29.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi