Example #1
0
        /// <summary>
        /// Writes an array of bytes to the I2C device.
        /// </summary>
        /// <param name="writeBuffer">The array of bytes that will be sent to the I2C device.</param>
        /// <param name="timeout">The amount of time, in milliseconds, that the system will wait before resuming execution of the transaction.</param>
        /// <returns>The number of bytes of data transferred in the transaction.</returns>
        public int Write(byte[] writeBuffer, int timeout)
        {
            var transactions = new I2CDevice.I2CWriteTransaction[] { I2CDevice.CreateWriteTransaction(writeBuffer) };

            return(Interface.Execute(transactions, timeout));
        }