Hi everyone!
I'm having some problems receiving bytes of data over bluetooth.
The project I'm trying to make is a bluetooth oscilloscope. I have a microcontroller that samples the signal, and then it sends it as a single byte to my android device using a TTL to bluetooth adapter. Then I want to display the signal on the screen.
I'm sucked now in the communications. The android device receives the data as a character, then I tried to use the ByteConverter library to interpret the character:
Dim bc As ByteConverter
Dim Data(1) As Char
Dim Number(1) As Byte
Data(0) = TextReader1.ReadLine
Number = bc.CharsToBytes(Data)
When I receive a number between 0 and 127, this code works just fine. However, when I receive a larger number it just returns -3.
I'd appreciate any help in other ways to change from chars to bytes.
I'm having some problems receiving bytes of data over bluetooth.
The project I'm trying to make is a bluetooth oscilloscope. I have a microcontroller that samples the signal, and then it sends it as a single byte to my android device using a TTL to bluetooth adapter. Then I want to display the signal on the screen.
I'm sucked now in the communications. The android device receives the data as a character, then I tried to use the ByteConverter library to interpret the character:
Dim bc As ByteConverter
Dim Data(1) As Char
Dim Number(1) As Byte
Data(0) = TextReader1.ReadLine
Number = bc.CharsToBytes(Data)
When I receive a number between 0 and 127, this code works just fine. However, when I receive a larger number it just returns -3.
I'd appreciate any help in other ways to change from chars to bytes.
Last edited: