new I2cConnectionSettings(1, 0x62); using I2cDevice device=I2cDevice.Create(settings); device.Write(start); Thread.Sleep(1000); SpanByte buffer = new byte[9]; device.Write(read); Thread.Sleep(50); while (true) { device.Read(buffer); var co2 = BinaryPrimitives.ReadInt16BigEndian(buffer.Slice(0,3)); var tmp = -45 + 175 * (float)(BinaryPrimitives.ReadUInt16BigEndian(buffer.Slice(3, 3))) / 65536; var hum = 100 * (float)(BinaryPrimitives.ReadUInt16BigEndian(buffer.Slice(6, 3))) / 65536; string data = $"{{¥"co2¥":{co2.ToString()},¥"tmp¥":{tmp.ToString("F2")},¥"hum¥":{hum.ToString("F2")}}}¥r¥n"; serial.Write(data); Debug.Write(data); Thread.Sleep(60000); } }