Created
June 27, 2022 13:38
-
-
Save hatsunea/72b7dc32273d738da49c34f2abf8fc5f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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