I'm using the SerialExample to connect to a custom Bluetooth device and read some data.
In the Timer tick I am able to read the data from the port:
The data sent by the device is unsigned 0...255. How do I extract this data from the Buffer?
If I use Asc(Buffer(x)) I get the correct value when the data is under 128, above that I get 65533 no matter what the value is.
The serial example is great, it just has been a long time since I've programmed in Basic
Thanks in advance,
D2.
In the Timer tick I am able to read the data from the port:
B4X:
Dim Buffer(20) As Char
Dim Count As Int
Count = TextReader1.Read(Buffer,0,19)
The data sent by the device is unsigned 0...255. How do I extract this data from the Buffer?
If I use Asc(Buffer(x)) I get the correct value when the data is under 128, above that I get 65533 no matter what the value is.
The serial example is great, it just has been a long time since I've programmed in Basic
Thanks in advance,
D2.
Last edited: