Our compiler doesn't give us any warnings about uninitiialized variables, do you think it would be worth tracking everything down just to make sure?
Our robot has an analog module on slot 1, a digital module hooked to the sidecar on slot 4, and a relay module and pneumatics bumper on slot 8.
The code we're using(without the irrelevant things that don't make it break) is :
Code:
class testRobot : public IterativeRobot
{
//set up roller
Victor *rollerMotor;
RobotDrive *testDrive;
Victor *kickerWinch;
Jaguar *armWinch;
AnalogChannel *pot;
Gyro *angle;
public:
testRobot(void) {
kickerWinch=new Victor(3);
armWinch=new Jaguar(1); //TODO:Fix this so we're using both motorz
rollerMotor=new Victor(4);
testDrive=new RobotDrive(5,6,7,8);
angle=new Gyro(1);
pot=new AnalogChannel(3);
}
...
void RobotInit(void) {
testDrive->SetInvertedMotor(RobotDrive::kFrontLeftMotor,true);
testDrive->SetInvertedMotor(RobotDrive::kFrontLeftMotor,true);
pot->SetAverageBits(30);
}
...
void DisabledPeriodic(void) {
GetWatchdog().Feed();
printf(" pot=%f\n ",pot->GetAverageVoltage());
}