Greeting guys
what i'm tying to do is sort of pinging a device for a three times
and i want to know why the I2C execution return 0 in the first time but not in the rest.
var config = new I2CDevice.Configuration(83, 100); var I2C_Bus = new I2CDevice(config); I2CDevice.I2CTransaction[] transactions; transactions = new I2CDevice.I2CTransaction[2]; transactions[0] = I2CDevice.CreateWriteTransaction(new byte[1]); transactions[1] = I2CDevice.CreateReadTransaction(new byte[1]); for (var i = 0; i < 3; i++) { int result = I2C_Bus.Execute(transactions, 1000); if (result > 0) { Debug.Print("found"); } else { Debug.Print("not found"); } }
This is the debug result i get :
not found found found
any ideas?