PWM 1 is connected to the Jaguar controlling the LEFT motor, and PWM is controlling the RIGHT motor
This is the whole program
Quote:
#include "WPILib.h"
#include "vxWorks.h"
#include "Vision/AxisCamera2010.h"
#include "PCVideoServer.h"
class RobotDemo : public SimpleRobot
{
RobotDrive myRobot; // robot drive system
Joystick stick;
Compressor airc;
public:
RobotDemo(void):
myRobot(1, 2), // these must be initialized in the same order
stick(1), // as they are declared above.
airc(1,1)
{
GetWatchdog().SetExpiration(1.0);
GetWatchdog().SetEnabled(false);
AxisCamera &camera = AxisCamera::getInstance();
camera.writeResolution(k640x480);
camera.writeBrightness(10);
camera.writeCompression(25);
airc.Start();
}
void Autonomous(void)
{
GetWatchdog().SetEnabled(false);
Solenoid *s1;
Solenoid *s2;
s1 = new Solenoid(1);
s2 = new Solenoid(2);
Wait(3.000);
s1->Set(true);
s2->Set(false);
Wait(3.000);
s1->Set(false);
s2->Set(true);
}
void OperatorControl(void)
{
GetWatchdog().SetEnabled(true);
while (IsOperatorControl())
{
GetWatchdog().Feed();
myRobot.ArcadeDrive(stick); // drive with arcade style (use right stick)
Wait(0.005); // wait for a motor update time
}
}
};
START_ROBOT_CLASS(RobotDemo);
|