/// <summary> Writes the data as given to the device at the specified address. </summary> /// <param name="Address"> The address of the device to write data to. </param> /// <param name="Data"> The 8-bit data to write to the device. </param> public void Write(byte Address, byte[] Data) { CheckDev(Address); lock (this.BusLock) { foreach (byte Byte in Data) { RaspberryPi.I2CWrite(this.DeviceIDs[Address], Byte); } } }
public void Write(byte Address, byte[] Data) { if (this.DeviceIDs[Address] < 1) { this.DeviceIDs[Address] = RaspberryPi.I2CSetup(Address); } foreach (byte Byte in Data) { RaspberryPi.I2CWrite(this.DeviceIDs[Address], Byte); } }