I want to send a number through serial Bluetooth from an Arduino to an Android application.
I've managed to send 1 byte using the following code in C++:
int number = 255;
SerialBT.write((uint8_t*)&number,1);
SerialBT.flush();
This works fine, but since Arduino won't admit int16 or any other pointer bigger than 1 byte, I need to "chunk" the number down to 8-bit parts, and send each "chunk" at a time.
For example: if I need to send the number "725", which is 10 1101 0101 in binary, I would need to send 2 bytes:
How can I divide a number into "8 bit chunks"?
