I probably get this all wrong,
but I send byte arrays from an Arduino
and I end up receiving Character strings in B4J (???!)
The source is based upon the Chat example
The relevant Arduino sketch part is:
I expect the result to be:
1 2 3 13 10
But I get:
49 50 51 49 49
In the arduino serial monitor everything seems like I expected.
Does Astream do any translations, and how do I prevent that, or is there something else going on?
but I send byte arrays from an Arduino
and I end up receiving Character strings in B4J (???!)
The source is based upon the Chat example
B4X:
Sub AStream_NewData (Buffer() As Byte)
For Each n As Byte In Buffer
txtLog.Text=txtLog.Text & Asc(n) & " "
Next
txtLog.Text=txtLog.Text &CRLF
txtLog.SetSelection(txtLog.Text.Length, txtLog.Text.Length)
End Sub
B4X:
byte buf1[6]={1,2,3,13,10};
Serial.write( buf1,5);
I expect the result to be:
1 2 3 13 10
But I get:
49 50 51 49 49
In the arduino serial monitor everything seems like I expected.
Does Astream do any translations, and how do I prevent that, or is there something else going on?