BluetoothClient: why do I receive a negative value?

can i ask a question?

this is my blocks and program




why after i click one on my app, the label will show negative number like -16

That is a signed 4byte number, so have you checked the output of the device your app is connect to?

Try the ReceiveText method together with the value -1

ReceiveText(numberOfBytes)

Reads a number of bytes from the input stream and converts them to text.

If numberOfBytes is negative, read until a delimiter byte value is read

Taifun
PS: for new questions please start a new thread next time...

i have tried 1byte and 4byte it all will show negative number

you mean this?


but my app will receive some weird symbol
and i will start a new thread thank you your inform

well, my suggestion was

you also can do that...
how did you set the delimiter?
see also @ABG's standard answer to these kind of questions

Taifun
PS: I now moved your question into an new thread...

can i ask a question?

this is my blocks and program


why after i click one on my app, the label will show negative number like -16, -63, -1 or something like these

Thanks to your helping i have solve that problem im very aprreciate you.

Great
Please let us know what exactly was the solution for you
You also might want to provide a screenshot...

Taifun

sorry.... im just stupid, the problem is my Pinleg isn't setting correct
after i setting correct i can receive right number.
thank you for your helping again.

1 Like

we have all done that :upside_down_face:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.