public int GetChannel(Channels channel)
{
//Odd high
//Even low
byte[] msb = new byte[]
{
(byte)((int)channel << 1)
};
byte[] lsb = new byte[]
{
(byte)(((int)channel << 1) + 1)
};
byte[] msbOut = new byte[1];
byte[] lsbOut = new byte[1];
I2CDevice.I2CTransaction[] transaction = new I2CDevice.I2CTransaction[]
{
I2CDevice.CreateWriteTransaction(msb),
I2CDevice.CreateReadTransaction(msbOut),
I2CDevice.CreateWriteTransaction(lsb),
I2CDevice.CreateReadTransaction(lsbOut),
};
int output = ((((int) msbOut[0]) << 8) | (lsbOut[0]));
return output;
}