Skip to content

Instantly share code, notes, and snippets.

@hatsunea
Created June 27, 2022 13:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hatsunea/72b7dc32273d738da49c34f2abf8fc5f to your computer and use it in GitHub Desktop.
Save hatsunea/72b7dc32273d738da49c34f2abf8fc5f to your computer and use it in GitHub Desktop.
private SpanByte ReadToPressure(Register register)
{
var result = new byte[4];
SpanByte writeBuff = new byte[]
{
(byte)register,
};
SpanByte readBuff = new byte[4];
this.I2c.Write(writeBuff);
Thread.Sleep(20);
this.I2c.Read(readBuff.Slice(1));
result = readBuff.ToArray();
return result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment