Recieving 2 byte number via bluetooth

So this is the part in question. When I send a number like say 260 from my ESP32 via bluetooth I get somthing like 7460 in the label text. Does anyone know why this is the case, any help appreciated, thanks.

Imgur

Show us how you send the 260

The first problem I see is that you are using "ReceiveSigned2ByteNumber" instead of "ReceiveUnsigned2ByteNumber". Then send 260 from Arduino to the app and take a screenshot of the screen after receiving the data. We want to see it clearly. And as ABG mentions, show the Arduino code.

So here is the code in my ESP32

#include "BluetoothSerial.h"
BluetoothSerial ESP_BT;
int WriteFlashCtForSendingToApp = 0;
//
// when I send a number 3 to the app the following lines are exectued

WriteFlashCtForSendingToApp = 260;
ESP_BT.write(WriteFlashCtForSendingToApp);

I can't show a screenshot of the app because now when I receive either a Unsigned2ByteNumber or a Signed2ByteNumber it crashes the app. I'm having no problem receiving a 1 byteUnsignedNumber though, but obviously this is no good for sending numbers higher than 255.

Post the aia file of the project that is crashing.

RGB2.aia (40.2 KB)

Make it easier for yourself and do it this way:

#include "BluetoothSerial.h"
BluetoothSerial ESP_BT;
int WriteFlashCtForSendingToApp = 0;
//
// when I send a number 3 to the app the following lines are exectued

WriteFlashCtForSendingToApp = 260;
ESP_BT.println(String(WriteFlashCtForSendingToApp));

Yes thats worked thanks.