Thanks that did speed it up some more doing the 1 read of 6 bytes. I implemented the stopwatch function and here are the findings:
Setting the Device Config: 0Ms - 40Ms
magDevice.Config = mag0;
Sending the setup routine: 159Ms - 165Ms
magDevice.Execute(refillTrans, 1); magDevice.Execute(setTrans, 1); magDevice.Execute(resetTrans, 1); magDevice.Execute(takeTrans, 1);
Checking reading is ready (Status): 0Ms - 40Ms
while (((statusBit[0] & 0x01) != 1)) { magDevice.Execute(statusTrans, 1); }
Reading the 6byte reading: 40Ms
magDevice.Execute(getReadings, 1); //#Definition from outside loop: //byte[] dataXYZ = new byte[6]; //I2CDevice.I2CTransaction[] getReadings = new I2CDevice.I2CTransaction[2]; //getReadings[0] = I2CDevice.CreateWriteTransaction(new byte[] { 0x00 }); //getReadings[1] = I2CDevice.CreateReadTransaction(dataXYZ);
Assigning to the Byte Structure 0Ms
magData.mag0Xl = dataXYZ[0]; magData.mag0Xh = dataXYZ[1]; magData.mag0Yl = dataXYZ[2]; magData.mag0Yh = dataXYZ[3]; magData.mag0Zl = dataXYZ[4]; magData.mag0Zh = dataXYZ[5];
The entire loop of the 3 sensors takes: 600Ms - 650Ms
In order to get to the arduino # of readings I need the 3 sensors to take about 30 milliseconds, which I'm thinking might not be near possible? Unless I'm still doing some really dumb things, which is always possible LOL.