Go to Post We draw the line when our students are more affectionate towards the tools rather than eachother. - ksafin [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 13-01-2009, 16:53
jkjohnson jkjohnson is offline
Registered User
AKA: jasmin johnson
FRC #1748 (Lab Rats)
Team Role: Programmer
 
Join Date: Feb 2007
Rookie Year: 2007
Location: Baltimore
Posts: 4
jkjohnson is an unknown quantity at this point
Need help in c++ and windriver

Im new to programming in c++ and using the windriver enviornment. I was wondering if any one could post example drivecode (I read the simple robot code and it did not work when I downloaded it).

ThanK you in advance!!!
Reply With Quote
  #2   Spotlight this post!  
Unread 13-01-2009, 17:27
wt200999's Avatar
wt200999 wt200999 is offline
Texas Instruments
AKA: Will Toth
FRC #3005 (Robochargers)
Team Role: Mentor
 
Join Date: Mar 2006
Rookie Year: 2004
Location: Dallas, Texas
Posts: 323
wt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud of
Send a message via MSN to wt200999
Re: Need help in c++ and windriver

Are you using the SimpleTemplate example? What kind of drive are you planning on? Arcade drive? Tank drive? How many motors, and do you have your control system all wired up? And have you looked at the documentation?

http://www.chiefdelphi.com/forums/sh...ad.php?t=71498
__________________
Programming in LabVIEW? Try VI Snippets!

FIRST LEGO League 2004 - 2005
FRC Team 870 Student 2006 - 2009
FRC Team 3005 Mentor 2013 -
Reply With Quote
  #3   Spotlight this post!  
Unread 13-01-2009, 18:24
jkjohnson jkjohnson is offline
Registered User
AKA: jasmin johnson
FRC #1748 (Lab Rats)
Team Role: Programmer
 
Join Date: Feb 2007
Rookie Year: 2007
Location: Baltimore
Posts: 4
jkjohnson is an unknown quantity at this point
Re: Need help in c++ and windriver

yes we used the simple template.... we are planning on using tank drive... we have 4 motors...yes the control system is wired up
Thankyou
Reply With Quote
  #4   Spotlight this post!  
Unread 13-01-2009, 18:50
wt200999's Avatar
wt200999 wt200999 is offline
Texas Instruments
AKA: Will Toth
FRC #3005 (Robochargers)
Team Role: Mentor
 
Join Date: Mar 2006
Rookie Year: 2004
Location: Dallas, Texas
Posts: 323
wt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud of
Send a message via MSN to wt200999
Re: Need help in c++ and windriver

Read up on the documentation for different objects. You need to create objects for the different things you are using, then you need to define where they are plugged in, then just implement them in the operator control. I would suggest reading up, look in this folder for documentation
C:\windriver\docs\extensions\FRC\

here is an example adapted from the simple robot example:

Code:
class RobotDemo : public SimpleRobot
{
	RobotDrive* myRobot; // robot drive system
	Joystick* m_leftStick;
	Joystick* m_rightStick;

public:
	RobotDemo(void)
	{
		GetWatchdog().SetExpiration(100);
		//candidates are RobotDrive( LeftFront, LeftRear, RightFront, RightRear);
		myRobot = new RobotDrive(1,3,2,4); //adapt to what yours are
		m_leftStick = new Joystick(1); //once again adapt these to what you have
		m_rightStick = new Joystick(2);
	}

	void Autonomous(void)
	{
		while (IsAutonomous())
		{
			GetWatchdog().Feed();
			//auton code here
		}
	}

	void OperatorControl(void)
	{
		GetWatchdog().SetEnabled(true);
		while (IsOperatorControl())
		{
			GetWatchdog().Feed();
			myRobot->TankDrive(m_leftStick, m_rightStick);
		}
	}
};
__________________
Programming in LabVIEW? Try VI Snippets!

FIRST LEGO League 2004 - 2005
FRC Team 870 Student 2006 - 2009
FRC Team 3005 Mentor 2013 -
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
help:Downloading the project in windriver mahmosh C/C++ 5 10-01-2009 10:08
WindRiver Installation Issues - can you help a brother out? tdressel C/C++ 1 08-01-2009 00:42
Need interupts help, and another question... Kevin Karan Programming 7 22-02-2004 11:20
We NEED 8-inch wheels and programming help archiver 2001 7 24-06-2002 00:29


All times are GMT -5. The time now is 13:40.

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