VB code is sending a single byte with the value of 2.
On the opposite site I am waiting a single byte with value = 2. With visual basic I can catch it, but with B4A I cant catch it.
It will be my mistake, something in B4A I am doing wrong. I am going to test it.
Thank you very much Erel
I am editing this message:
Erel, I am sending CHARACTER of byte = 2 .....
Data is always sent as raw bytes. Chr(2) will be sent as a single byte with the value of 2.
My guess is that the problem is somewhere else. Maybe the VB code adds an end of line character?
You need to convert the Array to a string. In HEX format for example to put it in a Editfield.
"[B@41a93130" is possibly the "Reference" to the Array. Not the array itself....
The array as it is defined cannot be cast to a string. But it have to cause you want to put it in a Label3.Text. I think B4A uses the Reference then ... But maybe @Erel can say exactly what [B@41a93130 is
I understand, but I need simply thing. In visual basic you can do it with: Port1.Write(Chr(2))
And I need the same with B4A. I am working on it. If I catch it I will write solution here.
For example
Chr(97) Returns character ">"
but here are characters which are not displayed as chr(2) or Chr(5) and I am trying to send this characters ( CHR code) via serial in basic4a
please it is possible to send via serial port special ascii codes ASCI= 0-32, for example ASCI code = 2, byte=2 (start of text)
similar as in visual basic Port1.Write(Chr(2))? http://en.wikipedia.org/wiki/ASCII