Quote:
Originally Posted by Alan Anderson
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.