Typically, there's two files, the header file and the CPP file.
Example Header
Code:
// Camera.h
#ifndef CAMERA_H
#define CAMERA_H
class Camera
{
public:
void doSometing();
};
#endif
Then make a .cpp file with the same name as the header file:
Code:
// Camera.cpp
#include "Camera.h"
void Camera::doSomething()
{
printf("Doing something...");
}
Now when you get to the robot code, all you need to do is simply include the "Camera.h" file:
Code:
//MyRobot.cpp
#include "Camera.h"
class MyRobot : public SimpleRobot
{
/* Code ommited for simplicity */
void Autonomous()
{
Camera c();
c.doSomething();
}
};
START_ROBOT_CLASS(MyRobot);
Hope this example helps...