Dim bc As ByteConverter ' Only used to log hex version of bytes to be sent
Dim sourceString As String = $"50${Chr(13)}"$
Dim bytesToSent() As Byte = sourceString.GetBytes("UTF8")
Log(bc.HexFromBytes(bytesToSent))
Dim bytesReceived() As Byte = Array As Byte (53,48,13)
Dim asString As String = BytesToString(bytesReceived, 0, bytesReceived.Length, "ASCII") ' ASCII received from microcontroller
Log(asString)
bytesReceived = Array As Byte (0x35, 0x30, 0x0D)
asString = BytesToString(bytesReceived, 0, bytesReceived.Length, "ASCII") ' ASCII received from microcontroller
Log(asString)