Beja Expert Licensed User Longtime User Jan 12, 2021 #1 Hi all, In the following code snippet, I have a byte array with constant values. I want to change the byte array elsewhere so when the next Timrt1_Tick event fires again the sub will send the new values, B4X: Copy If connected Then Timer1.Enabled=True 'Turn Right Dim a() As Byte = Array As Byte(83, 68, 82, 158, 127, 0, 1, 29) Dim out As OutputStream out = Serial1.OutputStream out.WriteBytes( a, 0, a.Length) out.Flush End If Best regards, B
Hi all, In the following code snippet, I have a byte array with constant values. I want to change the byte array elsewhere so when the next Timrt1_Tick event fires again the sub will send the new values, B4X: Copy If connected Then Timer1.Enabled=True 'Turn Right Dim a() As Byte = Array As Byte(83, 68, 82, 158, 127, 0, 1, 29) Dim out As OutputStream out = Serial1.OutputStream out.WriteBytes( a, 0, a.Length) out.Flush End If Best regards, B
DonManfred Expert Licensed User Longtime User Jan 12, 2021 #2 B4X: Copy Dim a() As Byte = yourstring.GetBytes("UTF8") Upvote 0