Bluetooth

Hello,

I was wondering if anyone could help and tell me a little about how to send a 16bit int via bluetooth from one arduino uno to another. I have two BT modules hc05 as master and hc06 on the other side. I already configured them and they are connected to each other.

Welcome,

I suggest you read this: http://forum.arduino.cc/index.php?topic=396450

Now if you want something much simpler, but also much less robust… you can do something like that:

Send:

int num = 1234;
uint8_t byte1 = num & 0xFF;
uint8_t byte2 = num >> 8;
Serial.write( byte1 );
Serial.write( byte2 );

Receive:

if ( Serial.available() == 2 )
{
	uint8_t byte1 = Serial.read();
	uint8_t byte2 = Serial.read();
	int num = byte1 | (byte2 << 8);
}