View Single Post
  #4   Spotlight this post!  
Unread 12-02-2010, 22:17
nathanww nathanww is offline
Hacker
FRC #1678 (Citrus Circuits)
Team Role: Programmer
 
Join Date: Dec 2008
Rookie Year: 2007
Location: Davis, CA
Posts: 224
nathanww is just really nicenathanww is just really nicenathanww is just really nicenathanww is just really nice
Re: Motor declarations break analog module

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());
	
	}
__________________
Get yer robot source code here!
Reply With Quote