Go to Post If this thread isn't a sign that CD is going through some serious withdrawals, I don't know what is. - Ty Tremblay [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 20-01-2012, 12:38
cjlane1138 cjlane1138 is offline
Team 1138
FRC #1138 (Eagle Engineering)
Team Role: Leadership
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Los Angeles
Posts: 88
cjlane1138 is an unknown quantity at this point
Re: Pointers Issues

Quote:
Originally Posted by Alan Anderson View Post
Is there indeed a Drive() constructor with no parameters?
No, I have a separate Drive class.

Drive.h
Code:
#ifndef DRIVE_H_
#define DRIVE_H_
#include "WPILib.h"

class Drive
{
public:
	Drive();
	
	RobotDrive *myRobot;
	
	Jaguar *leftmotor;
	Jaguar *rightmotor;
	
	Joystick *leftstick;
	Joystick *rightstick;
};

#endif
Drive.cpp
Code:
#include "WPILib.h"
#include "Drive.h"

Drive::Drive()
{
	printf("Initializing Drive.cpp\n");
	
	leftmotor = new Jaguar(1);
	rightmotor = new Jaguar(2);
	
	myRobot = new RobotDrive(leftmotor, rightmotor);
	
	leftstick = new Joystick(1);
	rightstick = new Joystick(2);
};
There is the header file and the cpp file.
MyRobot is in the main post.
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


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

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