Open schreiaj opened 10 years ago
Rough code that MIGHT read. No idea if it'll work.
I2C imu = I2C(1,125);
// Check that we can talk to the device otherwise handle this error
if imu.addressOnly(){
// Handle the case that something gone and screwed up
// BlameElectrical();
}
int[] buffer = int[6];
imu.read(0, 6, buffer);
yaw = buffer[0]<<8+buffer[1];
http://www.chiefdelphi.com/forums/showthread.php?p=1336742 Has some information on why we might have been getting 0s.
We need to get the IMU talking to the CRIO. Rough code sample coming shortly (20 minutes)