View Single Post
  #3   Spotlight this post!  
Unread 10-02-2011, 12:23
basicxman basicxman is offline
Emily Horsman
FRC #2200 (MMRambotics)
Team Role: Programmer
 
Join Date: Oct 2007
Rookie Year: 2007
Location: Burlington, Ontario
Posts: 971
basicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant futurebasicxman has a brilliant future
Send a message via AIM to basicxman Send a message via MSN to basicxman Send a message via Yahoo to basicxman
Re: NXT Compass Invalid Manufacturer Exception

Quote:
Originally Posted by Osprey1 View Post
Is anyone else getting this error? Did you fix it?
We are, and no we haven't fixed it, it's an issue with the WPI library.

Quote:
Originally Posted by Robototes2412 View Post
What language are you using?
This happens in C++.

I believe it might be due to the typo found in HiTechnicCompass.cpp. I haven't tried correcting this typo to see if it works without throwing an exception but this is probably the issue.
Quote:
Originally Posted by WPILibC++Rev2259
Code:
HiTechnicCompass::HiTechnicCompass(UINT32 slot)
	: m_i2c (NULL)
{
	DigitalModule *module = DigitalModule::GetInstance(slot);
	if (module)
	{
		m_i2c = module->GetI2C(kAddress);
	
		// Verify Sensor
		const UINT8 kExpectedManufacturer[] = "HiTechnc";
		const UINT8 kExpectedSensorType[] = "Compass ";
		if ( ! m_i2c->VerifySensor(kManufacturerBaseRegister, kManufacturerSize, kExpectedManufacturer) )
		{
			wpi_fatal(CompassManufacturerError);
			return;
		}
		if ( ! m_i2c->VerifySensor(kSensorTypeBaseRegister, kSensorTypeSize, kExpectedSensorType) )
		{
			wpi_fatal(CompassTypeError);
		}
	}
}
It shouldn't affect compass operations though.