WPI gyro code question

We hooked up the gyro (yeah!!!) and used WPI’s sample code. We found that thatthe gyro that came in the KOP does not work with WPI’s library. It will give you half (apx.) of the correct value. We hooked up an old gyro and found that it actually worked:). Next we doubled the value of SetSensitivity, we thought that this would fix the problem. What it actually did is halved the number we were getting. This made our reading 1/4 of what it actually should be. We looked at the library more and realized that the library was using the reciprocal of the number we were supplying to SetSensitivity. So we gave it half of the original number. Although this was closer to the actual reading, it still was not exact. Our best guess is that WPI made the gyro class with the old gyro, hence why our old gyro worked. Has anyone else found this problem, or the fix? Or do you know if WPI plans to put out a fix for this?

Don’t forget to read the sensor manual!

The WPIlib gyro/accelerometer code was written before we knew what this year’s sensors would be. It still works, you just need to wire in new constants, which are found in that manual.

It looks like they have the default Volts per degree per second as .0125 and this year’s sensor is 7mV per degree per second It should be in the sensor manual. Try .007 as sensitivity?

0.007 is what we are using. Now we just have to connect the temperature output to compensate for the error… :slight_smile: (which, the error is really low)